我试图使用WhatsAPI库通过计算机向智能手机发送消息。我通过在Linux计算机上使用mitmproxy获得了证书,然后我为iPhone安装了证书,并在连接Linux计算机的同一个wi网络上连接了iPhone (我设置了使用代理的网络)。
因此,我用上一步获得的凭据编辑了文件whatsapp.php (包含在Github包中),并在Shell中启动了该服务,以这样的方式向我的电话发送消息:
./whatsapp.php -s dest phone prova当我按下"enter“键时,它就开始工作了,我得到了以下信息:
[] Logging in as 'WhatsAPI Test' (from phone)
tx <stream:features></stream:features>
tx <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="WAUTH-2" user="from phone">??lg
@*?*]?Z??ù?%??\?Z??Ǚ??R0??q??*???kX?L?Y%3????p>R-A_j'??ǯYN?1ƿ#t?$s?????ORLUG?dBvoI?</auth>
rx <start from="s.whatsapp.net"></start>
rx <stream:features></stream:features>
rx <challenge>??2?a?
?dxւ??㶄?</challenge>
tx <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">u^?
)???4!???N?$+?H5??????Da?P</response>
rx <success t="1396431143" kind="free" status="active" creation="1396347026" expiration="1427883026">???'17?,E??.??}??</success>
rx <message from="dest phone@s.whatsapp.net" id="1396425196-49" retry="3" offline="3" type="text" t="1396431017" notify="Luca">
rx <body>Prova</body>
rx </message>
rx <ib from="s.whatsapp.net">
rx <offline count="1"></offline>
rx </ib>
tx <presence name="WhatsAPI Test"></presence>
[] Request last seen dest phone: tx <iq to="dest phone@s.whatsapp.net" type="get" id="lastseen-1396431145-1" xmlns="jabber:iq:last">
tx <query></query>
tx </iq>
rx <stream:error>
rx <xml-not-well-formed></xml-not-well-formed>
rx </stream:error>
[] Send message to dest phone: prova
tx <message to="dest phone@s.whatsapp.net" type="text" id="message-1396431150-2" t="1396431150">
tx <x xmlns="jabber:x:event">
tx <server></server>
tx </x>
tx <notify xmlns="urn:xmpp:whatsapp" name="WhatsAPI Test"></notify>
tx <request xmlns="urn:xmpp:receipts"></request>
tx <body>prova </body>
tx </message>我不明白服务器是否已经很好地阐述了我的请求,目前我没有收到任何WhatsApp信息在我的智能手机上。出什么事了吗?
发布于 2015-03-14 06:33:32
我知道这是相当古老的,但是,我想回答它。
可以从以下几行看出:
<message from="dest phone@s.whatsapp.net" id="1396425196-49" retry="3" offline="3" type="text" t="1396431017" notify="Luca">
rx <body>Prova</body>
rx </message>您没有更改目标电话号码,这就是为什么它显示
消息from="dest @s.whatsapp.net“
而且还
最后一次看到dest电话: tx iq to="dest phone@s.whatsapp.net“
只要输入你的目的地电话号码,你的代码就会正常工作。
P.S. WhatsApi不支持垃圾邮件,因此,如果您这样做,您的号码将被阻塞。
希望这能有所帮助。
https://stackoverflow.com/questions/22807529
复制相似问题