apns bad device token in ionic

I've developed an app with Ionic for Android and iOS devices.

I'm having trouble with the notifications for iOS. In development everything works fine, but in production, when I send the notification, it gets back to me with this error: `

APNS_BAD_DEVICE_TOKEN

The certificates that I've uploaded on ionic.io are the ones generated by distribution, I'm positive about that. APNS certificate such as APP Store one and Provisioning Profile as well.

If I download the app from the Apple Store i get the error I wrote before, and if I create it from Xcode, it works perfectly. Plus it generates two different device tokens (one with the App Store and another one from Xcode).

I've deleted and created the certificates many times, and everything is still working like that. I'm pretty lost here, can anyone help me out?

Upvotes: 0

Views: 3861

Answers (1)

Mathews
Mathews

Reputation: 909

If you are installing directly to your phone from Xcode, then you have to use Development security profile and make sure you are sending the notification from server side to iOS devlopment sand box. If you are using TestFlight/AppStore you need to use Production profile and make sure you are sending the notification to iOS production sandbox.

Upvotes: 1

Related Questions