The problem
I'm not receiving Push Notifications to my app when I'm working on it,
and the APN server returns "BadDeviceToken
".
The situation
I've got to be missing something simple here, this is the situation :
When I send a Push Notification to my app downloaded from the App Store it works
When I send a Push Notification from the same server, to the same version (*) of my app but built off Xcode, the APN server returns a
status: '400'
fail with thefailed[0].response.reason: 'BadDeviceToken'
(*) I say the same version, the code is the same and the plugins should be the same, but I have changed Cordova iOS version down to 3.x, from 4.x.
The tech
I'm using the newer method of Push Notifications where on the server I just have a .p8 APNs Auth Key on the server.
The server is node code using the node-apn plugin.
The client app is Cordova, using the Telerik Push Plugin.
What I've tried
I've tried creating a new APNs Auth Key and uploading that to the server; that still works on the App Store version of the app, and APN still returns "BadDeviceToken" when sending to my locally built version of the app.
I've tried setting
production: false
on the server config for node-apn before sending the push to my locally built app; I still get the "BadDeviceToken" error.Doing an extra hexadecimal encode to the token as per this question; result is that it still says "BadDeviceToken", though in that case it would actually be true.
Bumping the cordova-ios version back up to 4.3.1; still getting "BadDeviceToken".
Double checking that the "Push Notifications" Capability is on when building
Doing a Release build rather than a Debug build, as suggested here, and described here
The question(s)
Why is the APN server saying BadDeviceToken
when that is obviously not true?
And, how can I fix it?