mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user