title: Connecting to Apple push notifications service fails with an invalid token
body: <p>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.</p>
  
  <p>I have tried both the production and sandbox environments of APNS, using the same .pem file. Both fail.</p>
  
  <p>The app uses the Cordova Push Notification plugin for notifications.</p>
  
  <p>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.</p>
  
  <p>In Xcode (8.1) I let Xcode manage code signing automatically and picked our team. I switched on Push Notification in the capabilities tab.</p>
  
  <p>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.</p>
  
  <p>Is there something I need to configure in Xcode, on the server or perhaps in the app registration?</p>