I have a custom notification service that is successful in sending notifications but the didReceiveRemoteNotification is never called when the user clicks on the notification. The app will open to the last state and I'm trying to deep link to a specific scene in the app.
In my didFinishLaunchingWithOptions I am registering the notification types by calling into this function"
func registerForPushNotifications(application: UIApplication) { let notificationSettings = UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil) UIApplication.shared.registerUserNotificationSettings(notificationSettings) }
I'm registering my device with the backend service with the called to the didRegisterForRemoteNotificationsWithDeviceToken function
Next I have my didregister function
func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) { UIApplication.shared.registerForRemoteNotifications() }
Finally, I have the didReceiveRemoteNotification which I expect to be called when I tap on the notification.
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { }
The xml that is being posted to my backend service is fairly straight forward and seems to be working as expected: { "audience":{ "ios_channel":"e06b9r8r-ffce-4fa6-92ec-123456789" }, "notification":{ "ios":{ "alert":"Testing sounds send", "title":"Test Alert", "sound":"default" } }, "device_types":[ "ios" ] }
If anyone has input as to why the didReceiveRemoteNotification func isn't called would be greatly appreciated.