Commit fa17149d authored by Libin Lu's avatar Libin Lu Committed by GitHub

Merge pull request #985 from noambonnie/group-alert-behavior

Group alert behavior
parents 1525b511 b587872f
......@@ -92,7 +92,24 @@ public class SendNotificationTask extends AsyncTask<Void, Void, Void> {
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", "not-set");
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:
break; // Leave default behavior to Android defaults.
}
if (bundle.containsKey("groupSummary") && bundle.getBoolean("groupSummary")) {
notification.setGroupSummary(true);
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment