0

For a Cordova app I want to send a notification using Apple Push Notification service to an iPhone running iOS 10.1. When the back end connects to the Apple service to deliver a notification the connection fails with an invalid token.

I have tried both the production and sandbox environments of APNS, using the same .pem file. Both fail.

The app uses the Cordova Push Notification plugin for notifications.

The app was registered with have a certificate that includes the use of push notifications. From this a .pem file was created and uploaded to the server.

In Xcode (8.1) I let Xcode manage code signing automatically and picked our team. I switched on Push Notification in the capabilities tab.

The app is launched from Xcode to a connected iPhone. Registering in the app for push notification succeeds, I see the dialog to allow notification and the app sends the registration information to the back end.

Is there something I need to configure in Xcode, on the server or perhaps in the app registration?

Kwebble
  • 2,065
  • 14
  • 23
  • Have a look to my answer : http://stackoverflow.com/questions/39532953/push-notifications-not-being-received-on-ios-10-but-working-on-ios-9-and-before/40757029#40757029 answer no 2 – Dheeraj D Dec 15 '16 at 09:56
  • Have you checked the token Format ? means in token there should be no <,>,- – Sagar Shirbhate Dec 15 '16 at 10:09

2 Answers2

0

Faced similar issues. There might be few reasons: 1. you need to remove all the spaces and commas(if any) from your device token 2. Testing for sandbox and production environment is different: For sandbox use : ssl://gateway.sandbox.push.apple.com:2195 For Production use : ssl://gateway.push.apple.com:2195 3. Make sure you are configuring your provisioning profiles properly and making required changes in the memberportal. https://www.raywenderlich.com/123862/push-notifications-tutorial You can follow this link, might be a help.

Ritu
  • 84
  • 5
0

The subject in the .pem used on the server did not match the bundle ID of the app. Once they were identical sending a notification to the sandbox worked fine.

Kwebble
  • 2,065
  • 14
  • 23