2

I am using whatsapp api functions for send and receive messages to my close customers from last 3 months . Its working fine up to last 04th-December-2015. From 5th onwards i am not unable to send and receive messages to others, so i am download latest version of api files from github (https://github.com/WHAnonymous/Chat-API) and added to my host . After that i can able to send message to others but i can not receive massage from others . Please help me to get message from others . here i have attached my coding and result

 $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();
 }

and i got result like below

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>

2 Answers2

1

WhatsApp now supports end-to-end encryption so you need to install protobuf and curve25519

Take a look here : https://github.com/mgp25/Chat-API/wiki/Dependencies

hash-set
  • 186
  • 1
  • 12
0

The status of this library is: end of support. You have to fix doLogin function issue and then use this library again. Let me informed if you did, because I have same problem.

Hazem Matouk
  • 35
  • 1
  • 7