pcabreus / whatsapp-api
此包已被弃用且不再维护。未建议替代包。
一个 WhatsApp PHP 应用程序
v0.2.1
2015-08-07 19:15 UTC
Requires
- whatsapp/chat-api: ~2.5
This package is not auto-updated.
Last update: 2022-02-01 12:49:43 UTC
README
注意: https://www.linkedin.com/feed/update/urn:li:activity:6359786787627417600
此库是 "https://github.com/mgp25/Chat-API" 应用的简单 PHP 面向对象库。
完整文档请 阅读 wiki
安装
首先必须将库添加到你的 composer.json 文件中
[json]
"require": {
"pcabreus/whatsapp-api": "~0.1"
}
然后你需要使用 composer 安装库。
使用方法
之后你可以像这样使用 WhatsAppApi 类
[php]
//Create the service
$whatsAppApi = new WhatsAppApi();
//Configure the connexion with the user credentials
$whatsAppApi->config("1123456789", "pcabreus", "this-is-secret", false);
//Send a message to a contact
$whatsAppApi->sendMessage("1987654321", "This is a message", WhatsAppApi::MESSAGE_TYPE_TEXT);
//Or you cant send a message to a group of contact
$numbers = array("1987654321", "44123456789");
$whatsAppApi->sendMessage($numbers, "This message go to many users", WhatsAppApi::MESSAGE_TYPE_TEXT);
待办事项
更多文档...