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:
mjs 2018-04-10 15:41:55 +02:00 committed by GitHub
parent a0f8443593
commit daa8f9cbc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ public class RNFirebaseNotificationManager {
} }
private void cancelAlarm(String notificationId) { 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); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, notificationId.hashCode(), notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.cancel(pendingIntent); alarmManager.cancel(pendingIntent);
} }