Using POST method to send message but it return "Error=MissingCollapseKey"

45 views
Skip to first unread message

Eddie Hsieh

unread,
May 25, 2012, 11:42:41 PM5/25/12
to android-c2dm
I use GAE in python as my third party server to send message to the
mobile device.
The collapse_key has already been written into payload but it still
return Error=MissingCollapseKey.
Could someone help me? Thanks.

This is my code:

auth = "GoogleLogin auth=" + key
message = "my message"
rid = "APA91bFZK1AJgDjGvs........."
url = "https://android.apis.google.com/c2dm/send"
form_field = {"registration_id":rid, "collapse_key": "1", "data.msg":
message}

formdata = urllib.urlencode(form_field)
result = urlfetch.fetch(url=url,
payload=formdata,
method=urlfetch.POST,
headers={'Authorization':auth},
)

Reply all
Reply to author
Forward
0 new messages