Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Error: NotRigested by GCM with iOS #567

Closed
apolkingg8 opened this issue Feb 3, 2016 · 11 comments
Closed

Error: NotRigested by GCM with iOS #567

apolkingg8 opened this issue Feb 3, 2016 · 11 comments

Comments

@apolkingg8
Copy link

Just like @trsdln said in #548

I am able to get device token using this push plugin. Then I register token on server side. After that I send my first notification using GCM API and got success response but there is no notification on device. When I am trying to send second (and for all next notifications too) I got response:

{"error": "NotRegistered"}

iOS: 9.1
cordova-ios: 3.9.2
plugin: 1.5.3

PushNotification.init({
            android: {
              senderID: SENDER_ID
            },
            ios: {
              badge: true
              sound: true
              clearBadge: true
              senderID: SENDER_ID
              gcmSandbox: true
            },
            windows: {}
          });

It's works fine on android, any ideal with that?

@apolkingg8
Copy link
Author

@macdonst do you have any ideal where the problem is? or I lost any information you need?

@macdonst
Copy link
Member

macdonst commented Feb 4, 2016

@Demiurga no idea, I tried to reproduce this today and could not.

@trsdln
Copy link

trsdln commented Feb 5, 2016

Looks like we made some mistake while setting up APNs/GCM

@macdonst Is there any instruction/instruction for this setup we can use?

@shaoyunli
Copy link

We are experiencing exactly same issue. I have checked the provisioning file and certificates but could not see if there is anything wrong in the configuration.

@macdonst
Copy link
Member

macdonst commented Feb 8, 2016

Sorry all, GCM on iOS is like black magic. I can't even find the URL to enable GCM for iOS anymore. You'd think google would make it easier.

@shaoyunli
Copy link

@macdonst you can access https://developers.google.com/mobile/add to enable GCM for iOS. I have enabled the service for the app with App name and iOS bundle id. When enabling GCM for iOS, two certificates were uploaded. The two certificates are also bound to the iOS bundle id. The provisioning file was generated based on the iOS bundle id with the two certificates. I cannot see if there is anything I have done wrongly but am very frustrated it is just not working except the first time then 'NotRegistered' failure again.

In the issue #115, @bruno-serfe mentioned, The following certificates are needed.

  • Google Cloud Messaging. (APNS .p12 cert) - (I understand the two certs needed to be uploaded to enable the service
  • Make the push notification. (APNS .pem cert) - (Where do I need this .pem cert if I use node-gcm to send message on server. )

Do I miss to use the .pem cert so that the push notification does not work?

@shaoyunli
Copy link

@macdonst I have made some progress today to get the notification pushed to an iPad. I have not changed anything apart from adding an attribute gcmSandbox: "true". After the change, the messages were sent successfully. However I don't understand why the message can be sent through GCM sandbox rather than production. Is it because the certificate of my app on the iPad is a development certificate?

Besides, I used the server API Key which does not have GCM enabled for iOS. It looks like it doesn't matter to enable the service or not, and through GCM sandbox, the notifications can still be pushed to iOS devices.

Dose it make any sense?

@macdonst
Copy link
Member

@shaoyunli if you build your app as development then you need to set gcmSandbox:true. If you build your app for production then you need to set gcmSandbox:false.

@rkj1515
Copy link

rkj1515 commented Feb 16, 2016

I am getting successful registration Token
Your Default init json should be like for iOs
ios: {
senderID: "XXXXX",
"gcmSandbox": "true",//for Testing purpose
"alert": "true",
"badge": "true",
"sound": "true",
"priority": "high",
clearBadge:"true"
}

here is a trick for upload APNS certificate .p12
follow this
some time export 2 time gives error so download certificate separate and merge both using cat cert.p12 key.p12 > cert_merged.p12
follow [this](http://stackoverflow.com/questions/31982238/gcm-certificate-configuration-not-working-or-ios upload your certificate)

you will get Registration token for APNS and GCM registration id both

@turbobuilt
Copy link

For me I found the issue was the gcmSandbox:true. You also have to have the right development certificate uploaded to google.

@macdonst macdonst closed this as completed Mar 9, 2016
@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

6 participants