ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 208 forks source link

IOS push through GCM is not going through #220

Closed sunojvijayan closed 8 years ago

sunojvijayan commented 8 years ago

I have installed tha app in android and the push is going through fine. After that I have followed the tutorial here https://developers.google.com/cloud-messaging/ to generate the .plist file and added it to ios. then tried pushing but GCM returns error saying token id not registered. I am using the same code to generate gcm id and it works fine. The only difference I can see is that there is a new credential generated when i created in GCM when I followed the tutorial above and it says server key in it instead of browser which is shown in android version. Please help

hypesystem commented 8 years ago

There will be a separate Api key for each device. Your iOS device does not use the same as the one you used for Android, so you probably just need to use the correct api key when sending to iOS devices.

sunojvijayan commented 8 years ago

I have tried that too. Is that the one which is auto generated when we complete the gcm process with certificates

sunojvijayan commented 8 years ago

I am getting this error

{ multicast_id: 5852817899341144000, success: 0, failure: 1, canonical_ids: 0, results: [ { error: 'InvalidRegistration' } ] }

sunojvijayan commented 8 years ago

There is something about a .pem file

hypesystem commented 8 years ago

Yes, it should be the one auto-generated when registering your iOS app for GCM.

InvalidRegistration means that the registration id you are trying to send to does not exist for the API key you are using.

sunojvijayan commented 8 years ago

I have tried another apns module but its working fine. But when sending to GCM it says invalidRegistration

sunojvijayan commented 8 years ago

After creating .plist file i have copied it to the project folder of ios

hypesystem commented 8 years ago

Have you followed the instructions for setting up GCM on iOS?

hypesystem commented 8 years ago

This is not a problem with the node-gcm library, but with your client implementation. You should probably consult StackOverflow or a similar place for an answer to the specific question :-)

clementsprs commented 8 years ago

@sunojvijayan Did you succeed ?