Merge pull request #633 from akshetpandey/fixNotificationCancelAllCrash
[android][messaging] Handle SecuritException in cancelAllLocalNotific…
This commit is contained in:
commit
a95c91e453
|
@ -104,7 +104,13 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements L
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void cancelAllLocalNotifications() {
|
public void cancelAllLocalNotifications() {
|
||||||
|
try {
|
||||||
mRNFirebaseLocalMessagingHelper.cancelAllLocalNotifications();
|
mRNFirebaseLocalMessagingHelper.cancelAllLocalNotifications();
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
// In some devices/situations cancelAllLocalNotifications will throw a SecurityException
|
||||||
|
// We can safely ignore this error for now as the UX impact of this not working is minor.
|
||||||
|
Log.w(TAG, e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
|
Loading…
Reference in New Issue