I am trying to understand while sending push notification,.I was expecting the message to be sent to all devices with same notification key, should I include both notification key and registration_ids in the payload.
But the notification was sent to only one device – only for the registration id that is mentioned below in the payload.
Looking at http://developer.android.com/google/gcm/notifications.html, I think I should post to https://android.googleapis.com/gcm/notification. instead of https://android.googleapis.com/gcm/send
The follwing works but the notification was only sent to only one device, eventhough I have two devices under same notification key.
Post to https://android.googleapis.com/gcm/send
Request Details Request Size: 510 Request Method: POST Request Content: {"registration_ids":["APA91bHjVoaAFnfTc2_tRfKNlHLADm9F0H01v2JhYUQdFsW5e15UToV4MklVXOreJ8vx8nmvyCUgXUMW0HnavRrqCqrtJaHsyYFP_bIMG4iagSS9DYkFkobQD8UaNKJUOLV2-v8TemQ38yWGOt7uxaOSZqru13lC-lC4lHR0-BDl-SzX_rOKVwc"],"data":{"quiettime":"false","badge":"9","title":"USAA","alert":"detail","sound":"default"},"notification_key":"APA91bHuyJIMwlz8_e8z6yq5qdPc32z9fAp9EV66EWl0jq_-A1F5-4nMlGH0EwPFpsHuCjhylKipfa4Z4IVagDsCDeNyi6jvbCIGq6iNf8IFLqH1bXH-_PSMjslLSQE15GCxCmZ9nTOX","collapse_key":"AlertMsgSync-4","time_to_live":1} Request : accept-language:en, accept-charset:iso-8859-1,*,utf-8*, user-agent:usaa, host:, connection:close, content-type:application/json, content-length:510, Response Details Response Size: 143 Response Content: {"multicast_id":5827412257797868612,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1380907967419523%395c8a4620a93e87"}]} Response Header: Expires:Fri, 04 Oct 2013 17:32:47 GMT, Cache-Control:private, max-age=0, X-Content-Type-Options:nosniff, X-Frame-Options:SAMEORIGIN, X-XSS-Protection:1; mode=block, Alternate-Protocol:443:quic
I am trying to understand while sending push notification,.I was expecting the message to be sent to all devices with same notification key, should I include both notification key and registration_ids in the payload.
But the notification was sent to only one device – only for the registration id that is mentioned below in the payload.
Looking at http://developer.android.com/google/gcm/notifications.html, I think I should post to https://android.googleapis.com/gcm/notification. instead of https://android.googleapis.com/gcm/send
and I should use send operation. But there is no sample payload for send operation. Can you please give me sample payload for send operation.
The follwing works but the notification was only sent to only one device, eventhough I have two devices under same notification key.
Post to https://android.googleapis.com/gcm/send
Request Details Request Size: 510 Request Method: POST Request Content: {"registration_ids":["APA91bHjVoaAFnfTc2_tRfKNlHLADm9F0H01v2JhYUQdFsW5e15UToV4MklVXOreJ8vx8nmvyCUgXUMW0HnavRrqCqrtJaHsyYFP_bIMG4iagSS9DYkFkobQD8UaNKJUOLV2-v8TemQ38yWGOt7uxaOSZqru13lC-lC4lHR0-BDl-SzX_rOKVwc"],"data":{"quiettime":"false","badge":"9","title":"USAA","alert":"detail","sound":"default"},"notification_key":"APA91bHuyJIMwlz8_e8z6yq5qdPc32z9fAp9EV66EWl0jq_-A1F5-4nMlGH0EwPFpsHuCjhylKipfa4Z4IVagDsCDeNyi6jvbCIGq6iNf8IFLqH1bXH-_PSMjslLSQE15GCxCmZ9nTOX","collapse_key":"AlertMsgSync-4","time_to_live":1}