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

[question]: Foreground at iOS not Working #987

Open
1 task done
walidabdelaziz opened this issue Jan 12, 2025 · 3 comments
Open
1 task done

[question]: Foreground at iOS not Working #987

walidabdelaziz opened this issue Jan 12, 2025 · 3 comments

Comments

@walidabdelaziz
Copy link

walidabdelaziz commented Jan 12, 2025

How can we help?

WARNING: OSNotificationLifecycleListener:onWillDisplayNotification timed out. Display was not called within 25.000000 seconds. Continue with display notification: 0
VERBOSE: finishProcessingNotification: Fired!
VERBOSE: Notification display type: 0
VERBOSE: notificationReceived called! opened: NO
VERBOSE: onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:
VERBOSE: onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler: Fired! WalidAbdelaziz_5459 sent a message
VERBOSE: OSNotificationWillDisplayEvent.preventDefault called.

OneSignal.Notifications.addForegroundWillDisplayListener((event) {
    print('Foreground Notification: ${event.notification.title}');
    event.preventDefault();
    event.notification.display();
  });

I got those and notifications is never shown at foreground at iOS while it's working at android
anda t background I receive it at iOS

Code of Conduct

  • I agree to follow this project's Code of Conduct
@walidabdelaziz
Copy link
Author

any updates???

@nan-li
Copy link
Contributor

nan-li commented Feb 11, 2025

Hi @walidabdelaziz can you share what version of the SDK you are seeing this on?

Also, is there a reason you call event.preventDefault() followed immediately by event.notification.display()? There is no need to call event.preventDefault() unless you want to prevent the notification from displaying.

@walidabdelaziz
Copy link
Author

@nan-li I'm using version onesignal_flutter: ^5.2.9

now I'm using
OneSignal.Notifications.addForegroundWillDisplayListener((event) {
event.notification.display();
});

and also not working

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

2 participants