You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented push notification but on latest iOS version foreground notification is not working even onNotification is not getting called ha had below changes but nothing seem to be working.
I have implemented push notification but on latest iOS version foreground notification is not working even
onNotification
is not getting called ha had below changes but nothing seem to be working.`-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
NSLog( @"Sagar_foreground" );
if (@available(iOS 14.0, *)) {
completionHandler(UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
} else {
// Fallback on earlier versions
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}`
Replacing above snippet with below it helped to call
onNotification
but its executing continuously in loop.`NSDictionary *userInfo = notification.request.content.userInfo;
//Foreground
NSLog(@"APP_PUSH from foreground %@", userInfo);
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:^void (UIBackgroundFetchResult result){}];
if (@available(iOS 14.0, *)) {
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBanner | UNNotificationPresentationOptionBadge);
} else {
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}`
The text was updated successfully, but these errors were encountered: