Chat-API获取在v3.2中加密的消息

时间:2016-03-07 15:49:09

标签: php encryption decode whatsapp

我正在使用Chat-API v3.2,我正在尝试接收whatsapp消息。 如何以最佳方式接收消息?当我收到他们时:

$w->pollMessage();

它提供了一些加密的消息:

rx  <message from="316**********@s.whatsapp.net" type="text" id="264A8F6D435E5A3E9A" offline="0" t="1457365604" notify="Hello">
rx    <enc v="2" type="pkmsg">33088cfcd5051221051ee62daa7e66ebe8459c328d7736fed71633d15d6a7374f48ce006358ceeca361a2105c36cb895c43536df0d48cad571da14a50a843a592bfa2bc43705f11e5443c05922f301330a210554b13d4c344c9da85819c9579d76f85bd546789fbbb4a2eca389414b9f06fa681009180022c001a6bbb88c07a1d4573b17701a2ef4462fdc328205057cf8fce09ccf13df33ce41bfb7d4472e2b7339571b0a4df956dc70f2815ca15e05febd639737b52e8dd3afd393b32ad569a326afa590c334d03b195b5f5705b003a400367833dc9c11e548e7e5e85af4cdea00574a59b58b92552b7bed9715022e91b6002372b93b2bc2feebe6924f2fdf572c47e6d88f3dbab036f7d63f1cc4b7e480b90c0dfe1433e594f245da633da810967f42b5963233a6ad6fa2a49ea60cd9af56743a9d5859e6141290091f2bccd46028ec233000</enc>
rx  </message>

如何解码此消息?或者我必须使用哪种功能?

谢谢!

1 个答案:

答案 0 :(得分:0)

好像你可以做到以下几点:

$w->pollMessage();
$msgs = $w->getMessages();
foreach ($msgs as $m) {
    // process inbound messages
    print($m->NodeString("") . "\n");
}

基于this example