Notification shown in foreground in iOS but not automatically processed after update from 3.1.9 to 7.3.1
I upgraded the plugin from version X to version Y. Everything seems to be fine.
I am experiencing a different behavior compared to the previous version, for simplicity I report three scenarios: IT WAS, AS IS and TO BE.
IT WAS (version 3.1.9):
🟢 [ok] iOS in closed state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟢 [ok] iOS in the background state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟢 [ok] iOS in the foreground state, the notification arrives, the bubble does not appear and the notification is immediately processed after the app opens. As desired.
On Android the behavior had to be identical to iOS, but due to some bug or problem there was a difference with apps in the foreground state, which for that last time we decided to ignore.
🟢 [ok] Android in closed state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟢 [ok] Android in the background state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟡 [unexpected, but tolerated] Android in the foreground state, the notification arrives, the bubble appears and the notification is immediately processed after the app opens. Unexpected, but tolerated. Tapping on the bubble with the app open caused the notification to be processed twice, fortunately ignored with an ad hoc workaround.
AS IS (version 7.3.1):
🟢 [ok] iOS in closed state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟢 [ok] iOS in the background state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🔴 [unexpected, and fix needed] iOS in the foreground state, the notification arrives, the bubble appears and the notification is not immediately processed ... you have to tap on the bubble. Unexpected.
🟢 [ok] Android in closed state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🟢 [ok] Android in the background state, the notification arrives, the bubble appears. Tap on the bubble, the notification is correctly processed after the app opens. As desired.
🔴 [unexpected, and fix needed] Android (identical to iOS) in the foreground state, the notification arrives, the bubble appears and the notification is not immediately processed ... you have to tap on the bubble. Unexpected.
TO BE (version 7.3.1)
Skipping the closed and background states because they are already as desired.
📝 iOS in the foreground state, the notification arrives, the bubble must not appear and the notification must be processed immediately ...
📝 Android in the foreground state, the notification arrives, the bubble should not appear and the notification must be processed immediately ...
So, in conclusion, we could say in general the upgrade operation was successful, but I would like to resolve the two foreground states for both platforms, from this point of view there is a regression. Could it be some configuration that is not working?
My cross-platform Notification configuration object passed to the notification.configure({...}) is following:
{
...
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
}
Any help is really appreciated.
Hi @strawberry-code Please refer to the CHANGELOG file. For iOS issues, please take a look to iOS repository. Also you will probably find issues in issue history of both repository. You are probably using a apple-deprecated method in AppDelegate. For Android, please check the readme, there is a way to exclude notification from foreground. Regards
Hi, I was able to set up notification channels on Android. However, the finding of this problem: when the app is totally closed (not present in the task manager) I send a "silent" notification.
Through metro bundler I see that it prints the configure logics and the push token comes, however it launches the onNotification is not provided (only if the first time a notification is sent after the app has been totally closed).
Without opening the app, immediately after I send a second notification, this is instead captured by the onNotification (within which then launch a local Notification).
Subsequent notifications were presented with the app closed, but it is needed to "warm up" the app with an initial notification. Could you help me figure out how to make sure that I can launch a local notification right away without having to launch a second notification?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.