Registering for remote notifications not working on physical device

Hi there,

There might be something obvious I'm overlooking, but I can't for the life of me figure it out.

Any help or guidance would be much appreciated!

I've enabled push notifications for one of my app identifiers (developer portal and provisioning profile appear to be correct, as does the entitlements file).

On a simulator, when I call registerForRemoteNotifications(), I immediately get a callback from didRegisterForRemoteNotificationsWithDeviceToken. However, when I run my app on any of my physical devices, this method is never called. Nor is didFailToRegisterForRemoteNotificationsWithError.

If I manually remove the aps-environment key and deploy to my device, then didFailToRegisterForRemoteNotificationsWithError is invoked with an expected error message.

Any idea what I may have done wrong here?

I'm using Xcode 15.0.1 and have tried an iPhone 12 (iOS 15.5) and iPhone 13 Pro Max (iOS 16.7.2).

My development environment requires a VPN, but I've tried disabling the VPN in case that was an issue.

I've also tried restarting the devices and toggling Wi-Fi, airplane mode, etc.

My app does integrate with Firebase (not FCM though), but I added the FirebaseAppDelegateProxyEnabled NO option, just in case (this wouldn't explain why it works on Simulator though).

Thanks for your help!

Registering for remote notifications not working on physical device
 
 
Q