Device token not being extracted - iOS app registered for push notifications but callback methods not called

Background: The project was created in Xcode 5, then recreated in new Xcode. Before migration, push notifications worked without issues, after migration device token stopped being extracted. Problem: iOS app registers for push notifications, but didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError methods are not being called. Current situation: App is registered for push notifications (isRegisteredForRemoteNotifications = true) Notification permissions are granted Entitlements are configured correctly (aps-environment: development) Bundle ID: com.autoserviceonline.app Team: BUSINESSVISION COMPANY, TOO (NS3FSG45V7) But callback methods are not being called What I've already tried: Deleted and recreated all App IDs in Apple Developer Portal Cleared Xcode cache and derived data Created new APNs certificates and provisioning profiles Removed "ghost" certificate from Keychain Access Problem persists Additional information: Also noticed that Push Notifications Console opens non-existent project "BV.TestSwiftData" with Personal Team instead of current corporate App ID com.autoserviceonline.app. These issues might be related to project migration from old Xcode. Request: Why iOS doesn't call callback methods for device token, although registration was successful?

There could be various reasons the callbacks are not happening. these range from network issues, especially caused by firewalls, etc. in a corporate environment, to misconfiguration of project variables, like the aps-environment entitlement.

You say the aps-environment is set to development, but that is probably what you are seeing in Xcode. Perhaps there is a build setting that is merging the wrong entitlement file with an invalid entry, or some other configuration issue due to the migration.

What I would suggest is first to create a very simple project that just registers for push notifications (you can even just use the sample project https://developer.apple.com/documentation/usernotifications/implementing-alert-push-notifications) and see if that works fine in your environment.

If it does, then I am afraid it will be up to you to compare what might be different in your main project that could be causing the problem.

Device token not being extracted - iOS app registered for push notifications but callback methods not called
 
 
Q