Hi, I'm experiencing the exact same issue with BadEnvironmentKeyInToken (HTTP 403) from APNs. In my case: I'm using a P8 key (not certificate-based auth) The P8 key was recently created with APNs service enabled Everything works fine with sandbox/development environment (Debug builds via Xcode) The error only occurs with production environment (TestFlight builds) My provisioning profile correctly shows aps-environment: production The device token is valid for production (confirmed by the profile) The strange part is: Sandbox server (api.sandbox.push.apple.com): Returns BadDeviceToken (expected, since token is for production) Production server (api.push.apple.com): Returns BadEnvironmentKeyInToken (HTTP 403) My JWT generation looks correct (same key works for sandbox), Team ID, Key ID, and Bundle ID are all verified to be correct. Did you ever find a solution to this issue?
Topic:
App & System Services
SubTopic:
Notifications