venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.14k forks source link

decode WhatsAPI received messages in readable form #1202

Open alishan305 opened 8 years ago

alishan305 commented 8 years ago

Hello,

I am using below code to receive whatsapp messages, Can anyone help me to decode the message in readable form.

PHP Code: $w->pollMessage(); $Messages = $w->getMessages(); foreach($Messages as $Message) { print_r($Message); }


Output is mentioned below:

( [tag:ProtocolNode:private] => message [attributeHash:ProtocolNode:private] => Array ( [from] => 9**0***19@s.whatsapp.net [type] => text [id] => 58AA2EAC84EF3ADC988C0D8178A9B9 [offline] => 0 [t] => 1459081717 [notify] => ali shan )

[children:ProtocolNode:private] => Array
    (
        [0] => ProtocolNode Object
            (
                [tag:ProtocolNode:private] => enc
                [attributeHash:ProtocolNode:private] => Array
                    (
                        [v] => 2
                        [type] => pkmsg
                    )
                [children:ProtocolNode:private] => 
                [data:ProtocolNode:private] => 3!�h����   kBB>�Ϫ<����1�; N�!l�H��T�;(뿪�dq�Ԓ��a�b?)2"�3!��U=mkA����P#S0Ġ�0d�A2\��B��UO0"�J��]��"K(���`!��m�&�r3k��hb_�`���ň;��M�]z��*�<h�����+���Q�4\�=��FN� Yx(~�.~G0�:DqR���ak�68pkղ0�~���hUة 7/ x�����G��2\"f6�#���64h��

�У=�������NS�&e��U*��� ��x ����&�o,�t���(�Ր$0��� ) ) [data:ProtocolNode:private] => )

kadnan commented 8 years ago

@alishan305 Did you get the answer?

mfadzil commented 8 years ago

Im sory, i cant..im not the expert, just newbies.. On Apr 11, 2016 5:46 PM, "Adnan Siddiqi" notifications@github.com wrote:

@alishan305 https://github.com/alishan305 Did you get the answer?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/1202#issuecomment-208259808

alishan305 commented 8 years ago

@kadnan No i did not get any reply.

alishan305 commented 8 years ago

Dear @mgp25 Can you please check what i am doing wrong, any configuration problem or what.

amec1234 commented 8 years ago

Are the messages marked as read?

kadnan commented 8 years ago

I finally sorted it out. Turns out that the Library was getting lost if send and receive both re same number. I arranged another number and worked like Charm