我在看这段代码:https://github.com/venomous0x/WhatsAPI
在页面上:/src/php/EXAMPLES.php
我做了以下的修改(我认为这是我需要修改的全部。)显然,我在本例中使用了不同的IMEI号码和移动号码):
$userPhone = '447799999999'; # Telephone number including the country code without '+' or '00'.
$userIdentity = '98B898B898B8'; # This is tipically the IMEI number.
# If you are using an iOS device you should input your WLAN MAC address.
$userName = 'John Doe'; # This is the username displayed by WhatsApp clients.
$destinationPhone = '447788888888'; # Destination telephone number including the country code without '+' or '00'.
# For groups: [phone number]-[group id].
$debug = TRUE;
$w->requestCode('sms', 'GB', 'en');
$w->registerCode('123456');但是,当导航到我的服务器上的这个example.php页面时,我会收到以下错误:
致命错误:没有异常的‘异常’与消息‘有一个问题,试图请求代码。in /whatsapp/src/php/Whsprot.class.php: 1174堆栈跟踪:#0 /whatsapp/src/php/EXAMPLES.php(49):WhatsProt->requestCode('sms','GB','en') #1 {main} {main}{main}抛入/whatsapp/src/php/whsprot.class.php第1174行
我只想知道我哪里出了问题,有人能给我一点启示吗?谢谢
发布于 2013-05-07 19:12:44
您在哪里实例化了WhatsProt类?您需要使用这一行:
$w = new WhatsProt($userPhone, $userIdentity, $userName, $debug);发布于 2016-01-23 21:41:56
另外,请确保您有最新的src文件,它在没有通知的情况下一直在更改,只需重新下载src文件并覆盖当前的文件。
https://stackoverflow.com/questions/16124538
复制相似问题