Push notifications can fail in TestFlight builds even when they work in local development, because the two use different Apple Push Notification service (APNs) environments.
- Development/debug builds (installed from Xcode) use the Sandbox APNs environment.
- TestFlight and App Store builds use the Production APNs environment.
The usual cause is that the Pushwoosh iOS configuration is still pointing at Sandbox while you test through TestFlight.
To resolve this:
- Log in to the Pushwoosh Control Panel and go to Settings → Configure platforms → iOS.
- Set the Gateway to Production.
- Check your credentials:
- APNs Auth Key (.p8) — the method recommended by Apple and Pushwoosh. A single key works for both Sandbox and Production, so you only need to switch the Gateway. Make sure the Key ID, Team ID and Bundle ID are correct.
- .p12 certificate — a legacy method kept for existing setups. If you use it, upload a certificate valid for Production (or a combined Sandbox & Production certificate) and make sure it matches your app's Bundle ID and has not expired.
- Save the configuration.
- Upload a new build to TestFlight and re-test. Devices that registered against the Sandbox environment hold sandbox tokens, so let the app register once on the TestFlight build before sending.
Also confirm your provisioning profile and Push Notifications entitlement are configured for production distribution.
Tip: to avoid flipping the Gateway back and forth, keep a separate Pushwoosh application configured with the Sandbox gateway for development builds.
Comments
0 comments
Please sign in to leave a comment.