Reputation: 23
NotificationService.m method not invoked. When in foreground, "willPresentNotification:(UNNotification *)notification withCompletionHandler:" this method is not called either.
No notifications are seen.
But this method "application:didReceiveRemoteNotification:fetchCompletionHandler:" is called for a silent notification pushed to the device. But the device is not receiving the usual push notifications.
Device token is all correct as silent notification is reaching, but normal push notifications alone are not reaching the on the customer device. Kindly help. This is only on a customer device with OS 14.3. The same notifications are reaching other devices. So no issues with the payload format. Kindly help.
Upvotes: -1
Views: 247
Reputation: 1652
Maybe there are some specific conditions in which the notifications delegate was not prepared to handled them.
Make sure to set the delegate for UNUserNotificationCenter
at application willFinishLaunchingWithOptions
. This is what Apple recommends to do on their documentation:
- (BOOL) application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
}
Upvotes: 2