[question]: Foreground at iOS not Working
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
- [X] I agree to follow this project's Code of Conduct
any updates???
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.
@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
same here, any update?
Hi there, can you let me know what happens if you omit the OneSignal.Notifications.addForegroundWillDisplayListener? Don't add the listener at all. Does the notification display in the foreground?