File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
OneSignalSDK/onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -100,19 +100,16 @@ static ArrayList<StatusBarNotification> getActiveGrouplessNotifications(Context
100
100
/**
101
101
* All groupless notifications are assigned the GROUPLESS_SUMMARY_KEY and notify() is called
102
102
*/
103
- @ RequiresApi (api = Build .VERSION_CODES .M )
103
+ @ RequiresApi (api = Build .VERSION_CODES .N )
104
104
static void assignGrouplessNotifications (Context context , ArrayList <StatusBarNotification > grouplessNotifs ) {
105
105
for (StatusBarNotification grouplessNotif : grouplessNotifs ) {
106
- Notification .Builder grouplessNotifBuilder ;
107
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
108
- grouplessNotifBuilder = Notification .Builder .recoverBuilder (context , grouplessNotif .getNotification ());
109
- } else {
110
- grouplessNotifBuilder = new Notification .Builder (context );
111
- }
106
+ Notification .Builder grouplessNotifBuilder =
107
+ Notification .Builder .recoverBuilder (context , grouplessNotif .getNotification ());
112
108
113
109
// Recreate the notification but with the groupless key instead
114
110
Notification notif = grouplessNotifBuilder
115
111
.setGroup (GROUPLESS_SUMMARY_KEY )
112
+ .setOnlyAlertOnce (true )
116
113
.build ();
117
114
118
115
NotificationManagerCompat .from (context ).notify (grouplessNotif .getId (), notif );
You can’t perform that action at this time.
0 commit comments