我正在使用 whatsapp api 功能向过去 3 个月的亲密客户发送和接收消息。直到 2015 年 12 月 4 日,它的工作正常。从 5 日起,我无法向他人发送和接收消息,因此我从 github ( https://github.com/WHAnonymous/Chat-API ) 下载最新版本的 api 文件并添加到我的主机。之后我可以向其他人发送消息,但我无法接收其他人的按摩。请帮我从别人那里得到消息。在这里我附上了我的编码和结果
$username='91735xxxxxx';
$identity='xxxxxxxxxxxxxxxxxxxxxxxx';
$nickname='prathis';
$debug=false;
$password='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
function onMessage($mynumber, $from, $id, $type, $time, $name, $body)
{
echo "Message from $name:\n$body\n\n";
}
$w = new WhatsProt($userPhone, $userIdentity, $userName, false);
$events = new MyEvents($w);
$w->eventManager()->bind("onGetMessage", "onMessage");
$w->eventManager()->bind("onGetImage", "Onmedia");
$w->Connect();
$w->loginWithPassword($password);
for($i = 0; $i < 10; $i++)
{
$w->pollMessage();
}
我得到了如下结果
tx <stream:features>
tx <readreceipts></readreceipts>
tx <groups_v2></groups_v2>
tx <privacy></privacy>
tx <presence></presence>
tx </stream:features>
tx <auth mechanism="WAUTH-2" user="917358559232">Àˆ Ý917358559232_åðñüu+V‹jÉ›H:TÆD)à1450186878</auth>
rx <start from="s.whatsapp.net"></start>
rx <stream:features></stream:features>
rx <challenge>âCê¦Ìù²àMf ¿7K㊑½@</challenge>
tx <response>Л×Ðî_’é@@k•¸¡H¼tú𬧈*½0l·¯œC§J</response>
rx <success t="1450186880" props="4" kind="free" status="active" creation="1436001708" expiration="1467537708">}eäl¾{d`S€ÆdœpÐ </success>
tx <presence name="f90xj0A5.0CF5A3169CBA5DE4329BFB1E9"></presence>
rx <message from="919659878706@s.whatsapp.net" type="text" id="75C870981298EBAE290" offline="3" t="1450186328" notify="A....s.....p">
rx <enc v="1" type="msg">3 !«ÎTÒÐ{üÕ¸-¿Ï½Mƒä‚Z.yÈÂ~•x6Æ"ǵ±#r°×üëi^¨¦BSA<</enc>
rx </message>
rx <message from="919659878706@s.whatsapp.net" type="text" id="75C870981298EBAE291" offline="1" t="1450186831" notify="A....s.....p">
rx <enc v="1" type="msg">3 !«ÎTÒÐ{üÕ¸-¿Ï½Mƒä‚Z.yÈÂ~•x6Æ"©¤wah‚Â2¦kÑjCðŠKWÅz{</enc>
rx </message>
rx <ib from="s.whatsapp.net">
rx <offline count="2"></offline>
rx </ib>
rx <presence from="917358559232@s.whatsapp.net"></presence>
rx <presence from="919659878706@s.whatsapp.net"></presence>