From 51721a950ff0888a7bb299a5c8b7fdabb3c822a9 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Tue, 27 Mar 2018 17:08:21 +0100 Subject: [PATCH] [notifications] Ensure error is always logged --- .../notifications/RNFirebaseNotificationManager.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 fe4c350a..f66aa122 100644 --- a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java +++ b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java @@ -444,9 +444,8 @@ public class RNFirebaseNotificationManager { Utils.sendEvent(reactContext, "notifications_notification_displayed", Arguments.fromBundle(notification)); } } catch (Exception e) { - if (promise == null) { - Log.e(TAG, "Failed to send notification", e); - } else { + Log.e(TAG, "Failed to send notification", e); + if (promise != null) { promise.reject("notification/display_notification_error", "Could not send notification", e); } }