If your iOS device is frequently being unregistered and you see a "Bad device token" error in your push history, it indicates a mismatch between your Pushwoosh application's configuration and your iOS app's build environment.
This error is returned by Apple's Push Notification Service (APNs) when a push notification is sent to the wrong gateway. For example, sending a push to a development app (which requires the Sandbox gateway) through the Production gateway will result in this error.
How to resolve the issue:
Identify your app's build type:
- Development/TestFlight builds: These builds use the APNs Sandbox environment.
- App Store builds: These are live builds for your users and use the APNs Production environment.
Check your Pushwoosh Configuration:
- Navigate to your application in the Pushwoosh Control Panel.
- Go to the iOS platform configuration settings.
- Find the Gateway setting.
Match the Gateway to your build type:
- If you are testing a development or TestFlight version of your app, set the Gateway to Sandbox.
- If your app is live on the App Store, set the Gateway to Production.
After you have aligned the Gateway setting with your app's build environment, the "Bad device token" errors should stop, and your device will remain registered correctly.
Comments
0 comments
Please sign in to leave a comment.