Closed zahs closed 1 year ago
same here only in ios
What is the parameter or configuration for them to be displayed?
I am facing similar issue. Any workaround?
Try adding this to AppDelegate.mm for iOS:
//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
@nguyendinhdoan Do you know how it will be possible to enable for Android?
I'll be working on it today or tomorrow and I'll let you know @zahs
for iOS I have added this to my AppDelegate.h
Update AppDelegate.h At the top of the file:
Then, add the 'UNUserNotificationCenterDelegate' to protocols:
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
and for AppDelegate.mm just follow these docs: https://wix.github.io/react-native-notifications/docs/getting-started#ios
and put this part from my top comment: https://github.com/wix/react-native-notifications/issues/891#issuecomment-1260741637
I have implemented all listeners as they should be, with background and foreground notifications
Perfect thank you :) for iOS it is working already for me.
android does not work
This was happening for us but then we realised it was necessary to explicitly handle the notification received foreground event in the react native code:
Notifications.events().registerNotificationReceivedForeground((notification, completion) => {
completion({ alert: true, sound: false, badge: false })
})
Without handling that event like that, no notifications were shown when in the foreground.
This was happening for us but then we realised it was necessary to explicitly handle the notification received foreground event in the react native code:
Notifications.events().registerNotificationReceivedForeground((notification, completion) => { completion({ alert: true, sound: false, badge: false }) })
Without handling that event like that, no notifications were shown when in the foreground.
I have followed the documentation and everything works correctly.
I also follow the doc but I did not get notifications when the android app is in the foreground.Please help us to implement.
In IOS Notification, image are not shown.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.
Platform: ios, Android
Notification is not popping up when app is in foreground. What can be the reason?