Merge branch 'master' of https://github.com/invertase/react-native-firebase
This commit is contained in:
commit
d9b033f6c7
@ -104,7 +104,13 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements L
|
|||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void cancelAllLocalNotifications() {
|
public void cancelAllLocalNotifications() {
|
||||||
mRNFirebaseLocalMessagingHelper.cancelAllLocalNotifications();
|
try {
|
||||||
|
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
|
||||||
|
@ -204,8 +204,11 @@ export default class Reference extends ReferenceBase {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const onCompleteWrapper = (error, committed, snapshotData) => {
|
const onCompleteWrapper = (error, committed, snapshotData) => {
|
||||||
if (isFunction(onComplete)) {
|
if (isFunction(onComplete)) {
|
||||||
if (error) return onComplete(error, committed, null);
|
if (error) {
|
||||||
return onComplete(null, committed, new Snapshot(this, snapshotData));
|
onComplete(error, committed, null);
|
||||||
|
} else {
|
||||||
|
onComplete(null, committed, new Snapshot(this, snapshotData));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) return reject(error);
|
if (error) return reject(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user