From f9552e01311258b43ee1a1763fc2c9b46504b435 Mon Sep 17 00:00:00 2001 From: Daniel Ericsson Date: Mon, 22 Apr 2019 15:58:42 -0700 Subject: [PATCH] Use `android_channel_id` field in notification data to determine which notification channel to use for delivering noisy push notifications. Or default to the standard hardcoded notification channel ID if the field is not specified. https://chefsteps.atlassian.net/browse/MOBCOOK-4510 --- .../modules/RNPushNotificationHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java index 4a45b46e3..7ddc5ddd4 100644 --- a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java +++ b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java @@ -205,7 +205,9 @@ public void sendToNotificationCentre(Bundle bundle) { } } - NotificationCompat.Builder notification = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) + String notificationChannelId = bundle.getString("android_channel_id", NOTIFICATION_CHANNEL_ID); + + NotificationCompat.Builder notification = new NotificationCompat.Builder(context, notificationChannelId) .setContentTitle(title) .setTicker(bundle.getString("ticker")) .setVisibility(visibility)