diff --git a/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java b/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java index df966356fc1e244642d9e6f2b72f68ef9b6d2985..0376a78012bde555bf7504329255d18fbc123821 100644 --- a/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java +++ b/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java @@ -92,7 +92,24 @@ public class SendNotificationTask extends AsyncTask { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ String group = bundle.getString("group"); if (group != null) group = URLDecoder.decode( group, "UTF-8" ); + notification.setGroup(group); + + String groupAlertBehavior = bundle.getString("groupAlertBehavior", "all"); + switch(groupAlertBehavior) { + case "children": + notification.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN); + break; + case "summary": + notification.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_SUMMARY); + break; + case "all": + notification.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL); + break; + default: + notification.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL); + } + if (bundle.containsKey("groupSummary") && bundle.getBoolean("groupSummary")) { notification.setGroupSummary(true); } diff --git a/index.d.ts b/index.d.ts index ac9fa5a5ebc028eed2b77ad0fb5d8c25465a6e99..74dfe4b76d1f7d33d9d0852ae2a9552031d92f61 100644 --- a/index.d.ts +++ b/index.d.ts @@ -89,6 +89,8 @@ declare module "react-native-fcm" { ticker?: string; auto_cancel?: boolean; group?: string; + groupSummary?: boolean; + groupAlertBehavior?: string; picture?: string; ongoing?: boolean; lights?: boolean;