From daa8f9cbc03c2d7b0c95d1125c672a788dbd09c5 Mon Sep 17 00:00:00 2001 From: mjs Date: Tue, 10 Apr 2018 15:41:55 +0200 Subject: [PATCH] fix cancelAlarm on android I noticed that firebase.notifications().cancelAllNotifications() has no effect on android phones. All scheduled notifications still appear. The propsed change fixes this. It was "inspired" by https://stackoverflow.com/questions/35341682/cancel-the-scheduled-android-notification/35342066#35342066 --- .../firebase/notifications/RNFirebaseNotificationManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java index d9f604a0..a4911a71 100644 --- a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java +++ b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java @@ -196,7 +196,7 @@ public class RNFirebaseNotificationManager { } private void cancelAlarm(String notificationId) { - Intent notificationIntent = new Intent(context, RNFirebaseNotificationManager.class); + Intent notificationIntent = new Intent(context, RNFirebaseNotificationReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, notificationId.hashCode(), notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); alarmManager.cancel(pendingIntent); }