0

I am using curl to send push notifications using GCM. Here it is as follows:

curl --header 'Authorization: key=myAPiKey' --header 'Content-Type: application/json' https://android.googleapis.com/gcm/send -d '{"registration_ids":["registration_ids"], "collapse_key": "Turn", "data": { "title": "fdsfdsfsdfd","body": "fdsf dsf sd fsd fds fds fds", "badge": "1" , "content_available": 1 ,"url": "#/app/home"} }'

In reposnse I am getting as :

{"multicast_id":7729772425353298779,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}

I am not getting registration_ids that are not registered. How Can I do this. I want this in curl only as i am using ruby 1.8.6 application.

Please help me on this

Ranzit
  • 1,327
  • 2
  • 13
  • 32
  • Since you're using the `content_available` parameter, I'm presuming you are sending the the notification to iOS. Have you already referred to the steps mentioned in the [docs](https://developers.google.com/cloud-messaging/http-server-ref#table5) for error `NotRegistered`? – AL. Jul 07 '16 at 11:38
  • no i am using it for android – Ranzit Jul 08 '16 at 02:49
  • Check this [SO question](http://stackoverflow.com/questions/26718115/gcm-error-not-registered) and this [Github issue](https://github.com/google/gcm/issues/49) if it can help you. – KENdi Jul 08 '16 at 14:21

0 Answers0