Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreground banner/alert notification is not working on iOS version 16.6 #423

Open
sagarhudge-eaton opened this issue Aug 28, 2023 · 4 comments

Comments

@sagarhudge-eaton
Copy link

sagarhudge-eaton commented Aug 28, 2023

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);
}`

@param240
Copy link

I do face this issue on IOS 16.6.
@sagarhudge-eaton Any update on the issue?

@AdrianDAdonis
Copy link

Same problem here, any update?

@davepaiva
Copy link

I too am facing this issue with iOS 17.2 and react native 0.73.2

@Qurat-ul-ainn
Copy link

facing same issue any solution plz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants