Friday, 15 March 2013

android - GCM send message to multiply devices -



android - GCM send message to multiply devices -

as part of using gcm interface, one's server needs utilize format in order send msg gcm server (which pass info devices):

headers = { 'content-type' : 'application/json', 'authorization': 'key=' + gcm_key } values = { 'registration_ids': [regid], 'data': {'msg': 'helo'} }

where: gcm_key server key , regid string of registration ids delimited ','.

say user has registration id of 1 , user b has registration id of 2.

when seek send message 1 device, e.g user a, regid equals string '1' , message passes correctly. same thing happens when seek pass message user 2 only.

but when seek send message both devices, regid = '1,2', message won't pass (by gcm documentation, success when response contains 0 failures , 0 canonical_ids, , i'm getting different successful response).

any ideas what's wrong?

the entire payload json, regid array needs json array. instead of '1,2' utilize ["1","2"].

android google-app-engine google-cloud-messaging

No comments:

Post a Comment