Is there a way how to display system notifications when app is in foreground?
@Daha62 please check this out.
Works in snapshot build
@harveyconnor, please could u provide some example?
Its actually in the docs
I got a notification icon and notification Notifications.postLocalNotification(...), but how can i create a notification popup like in reacte-native-firebase
firebase.notifications().displayNotification?
On ios, set the { alert: true } when calling completion handler. Its all in the docs.
See here: https://wix.github.io/react-native-notifications/docs/getting-started#register-for-notification-events
Notifications.events().registerNotificationReceivedForeground((notification: Notification, completion) => {
console.log(`Notification received in foreground: ${notification.title} : ${notification.body}`);
completion({alert: false, sound: false, badge: false});
});
Where it says
completion({alert: false, sound: false, badge: false});
You need to set to:
completion({alert: true, sound: false, badge: false});
alert:true still not working for me on 3.3.4
iOS 14.1
alert: true is not working for me neither
@harveyconnor any idea why this would be failing?
using 3.2.1 with iOS 13.6
no idea sorry
Most helpful comment
On ios, set the { alert: true } when calling completion handler. Its all in the docs.
See here: https://wix.github.io/react-native-notifications/docs/getting-started#register-for-notification-events
Where it says
You need to set to: