This 2 days need to add a script on the push, found the badge method can add script. Plus, but how to push is not successful. Depressed for a long time, on the Internet to find relevant information.
I finally found the reason:
"payload--up to 256bytes. "
It turns out that the payload bytes sent exceed the specified characters.
use Payload.getbytes (). length to get the number of bytes. See the next character number 240 bytes, no more than 256, repeated testing, learned that 256bytes is not accurate enough. The original payload some of the values are removed (Loginuri login, URI for jump), test again, push successfully.
========payload=========
Original:
{"Loginuri": "Http://192.168.1.8:8086/admin/msm/login", "MessageID": "580", "APS": {"alert": "Zheng sends you a work item", " Sound ":" Default "," badge ": 5}," uri ":" http://192.168.1.8:8086/admin/msm/login?module=WEIBO&moduleId= 93f7cf993df34d3dbc1681f08cced08c "}==== number of bytes ====250
NEW:
{"MessageID": "608", "APS": {"alert": "Zheng sends you a work item", "Sound": "Default"}, "uri": "Http://192.168.1.8:8086/admin /msm/login?module=weibo&moduleid=caedadfd80f841538a3414ca737c2ab0 "}==== number of bytes ====187
=======================
Original Address: http://www.eqishare.com/read.php?tid-980.html
More articles: http://blog.sina.com.cn/s/articlelist_1238625327_5_1.html