Shake event notification
Shake event notification
Interface Description
When the user enters the shake interface and shakes under the "Peripheral" page card, WeChat will push the event to the URL filled in by the developer (log in to the public platform and enter the developer center settings) . The push content includes the device information corresponding to the page displayed by the "nearby" page card when shaking, as well as the information of up to five nearby devices belonging to the public account. This event is not pushed when the list is shaken out.
If the WeChat server does not receive a response within five seconds, it will disconnect the connection and reinitiate the request, retrying three times in total. Regarding retrying message duplication, it is recommended to use FromUserName CreateTime to deduplicate messages. If the server cannot guarantee to process and reply within five seconds, you can directly reply with an empty string. The WeChat server will not do anything with this and will not initiate a retry.
Push XML packet example
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1433332012</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[ShakearoundUserShake]]></Event>
<ChosenBeacon>
<Uuid><![CDATA[uuid]]></Uuid>
<Major>major</Major>
<Minor>minor</Minor>
<Distance>0.057</Distance>
</ChosenBeacon>
<AroundBeacons>
<AroundBeacon>
<Uuid><![CDATA[uuid]]></Uuid>
<Major>major</Major>
<Minor>minor</Minor>
<Distance>166.816</Distance>
</AroundBeacon>
<AroundBeacon>
<Uuid><![CDATA[uuid]]></Uuid>
<Major>major</Major>
<Minor>minor</Minor>
<Distance>15.013</Distance>
</AroundBeacon>
</AroundBeacons>
</xml>
Parameter Description
Parameters | Description |
ToUserName | Developer WeChat ID |
FromUserName | Shake the user ( An OpenID) |
CreateTime | ##Message creation time (integer) |
MsgType | Message type, event |
Event | Event type, ShakearoundUserShake |
UUID, major, minor | UUID, major, minor |
Distance | The distance between the device and the user (floating point number; unit: meters) |