https://github.com/wix/react-native-notifications/issues/508 - this issue is closed, but bug is still remains in react-native-notifications: 3.2.2
Notifications.events().registerNotificationReceivedForeground((notification, completion) => {
completion({alert: true, sound: false, badge: false})
})
it always triggers when notification is sent but not always show system notifications
Hi @Daha62,
Did you test it on Android device or iOS device?
Hi @taduyde,
Android device is OK, problem is just on IOS
Hi @taduyde,
Android device is OK, problem is just on IOS
hmm, it's so strange, but I think you have a problem with your setup of the plugin. From my side. This plugin works well on iOS.
@taduyde, could u please show what u have in AppDelegate.m file?
cause i've done all that is written here https://wix.github.io/react-native-notifications/docs/getting-started#ios
also I have:
``
constructor(props) {
super(props);
Notifications.registerRemoteNotifications();
Notifications.events().registerNotificationReceivedForeground((notification: Notification, completion) => {
console.log(Notification received in foreground: ${notification.title} : ${notification.body}`);
completion({alert: true, sound: false, badge: false});
});
}
Hi @Daha62,
Before I show you AppDelegate.m, I have a question to make sure I guess the issue you meet is correct. For the app in the background or app is "dead" you still received the notification or not?
@taduyde
yep, I still received them.
I can receive them in foreground also (except first push)
Here is my AppDelegate.m, it's just simple.
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[RNNotifications startMonitorNotifications];
}
(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
[RNNotifications didFailToRegisterForRemoteNotificationsWithError:error];
}
thank u, unfortunately it's the same)
I have the same problem. First notification fails to show, afterwards everything's fine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Also seeing this same issue. First notification doesn't display, although the notification event happens and the correct notification data is received by the event handler.
Notifications after the first do show up.
A workaround is to dispatch a local notification immediately as the user registers - this notification won't show up and will make it so subsequent notifications do show up.
same issue, any updates
Just came across this issue, happens to me as well. First notification on foreground nothing, second shows.
I'm experiencing the same issue as well. Very first notification isn't received on iOS foreground but succeeding ones are received.