If you notice that push tokens for your iOS users are not appearing in User Explorer or are disappearing after being registered, it often leads to push delivery failures. This issue is typically caused by a configuration mismatch between your app's build environment and the gateway settings in your Pushwoosh Control Panel.
Primary Cause: APNs Gateway Mismatch
Apple uses two distinct environments for the Apple Push Notification service (APNs):
- Sandbox: For development and testing. Used for app builds installed directly from Xcode with a development provisioning profile.
- Production: For distribution. Used for app builds distributed via TestFlight or the App Store, signed with an Ad Hoc, Enterprise, or App Store provisioning profile.
Your Pushwoosh application's gateway setting must match the provisioning profile type used to sign your app build. If there is a mismatch (e.g., your app is a Sandbox build, but Pushwoosh is set to Production), APNs will invalidate the push token, causing it to be removed from the device's record in Pushwoosh.
How to Fix the Gateway Mismatch
You have two options to resolve this:
-
Change the Pushwoosh Gateway Setting:
- Log in to your Pushwoosh Control Panel.
- Navigate to your application and select the iOS platform configuration.
- Check the Gateway setting.
- Set it to Sandbox if you are testing a development build. Set it to Production for TestFlight or App Store builds.
-
Re-sign Your Application:
- If your goal is to test with a production environment, sign your application build with a production certificate (e.g., for TestFlight distribution) and ensure your Pushwoosh Gateway is set to Production.
Additional Recommendations
During our investigation, we identified other common issues that can affect push delivery:
Incorrect User Targeting: Be aware of the difference between a User ID (a primary Pushwoosh identifier) and a Tag. If you create a message and filter by a Tag named
userId
, it will not target devices based on their assigned Pushwoosh User ID. Ensure your segmentation logic targets the correct identifier.Handling User Logout: Avoid calling the
unregisterDevice
method when a user logs out. This completely removes the push token and makes the device unreachable. Instead, we recommend managing user transitions by using thesetUserID
method to assign a new, generic ID for logged-out users. This keeps the device registered and able to receive pushes upon the next login. For more details, see our guide on managing user transitions.
Comments
0 comments
Please sign in to leave a comment.