Closed jkasten2 closed 5 years ago
Issue is being addressed and is being tracked internally.
How was this resolved? I don't see groupedNotifications
in the event, which according to https://github.com/OneSignal/react-native-onesignal/issues/1046 is an issue with the native SDK...
Ideally, I'd want to have the most recent notification opened, with the rest left in place; is this still an option?
Just upgraded react-native-opensignal to 4.3.0, and while I do now see a groupedNotifications
property in the notification opened event, this property is null when a grouped notification was opened...
Issue
On Android Nougat (7.0)+ when 4 or more notifications are received Android will auto group them. However the
Intent
it sets up just launches the app's mainActivity
so this causes OneSignal to not be able to track an open.Workaround
Set the same Group Key for all your notifications. This will make the OneSignal Android SDK setup it's own group notification with it's own
Intent
.Implementation
Implementation Options
Need to re-evaluate what should happen when tapping on the summary notification to fix this issue. Three possible 3 candidates are;
Implementation Details
.setGroup
was called from the app'sNotificationExtenderService
.OSNotificationOpenResult.notification
contains the most recent howevergroupedNotifications
contains a list of all notifications in that ground.Solutions
Solution 1
Always set a group internally on Android 7+ so OneSignal will setup a group
Intent
. This will have the side effect of notifications grouping at 2 instead of 4 however.Solution 2
On Android 7+ check all notifications in the shade, if there are 3 currently in the shade create a group. It doesn't matter if the notification was created from OneSignal or not since we need to prevent Android from executing it's auto grouping at 4 notifications.