mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
Resolve display notification promise
Once the notification is created the promise was not being resolved so in a situation where the user is waiting on the promise to complete, they would not get a callback and in case a user used async/await this would cause the app to get stuck at that point.
This commit is contained in:
@@ -283,6 +283,11 @@ public class DisplayNotificationTask extends AsyncTask<Void, Void, Void> {
|
||||
if (reactContext != null) {
|
||||
Utils.sendEvent(reactContext, "notifications_notification_displayed", Arguments.fromBundle(notification));
|
||||
}
|
||||
|
||||
if (promise != null) {
|
||||
promise.resolve(null);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to send notification", e);
|
||||
if (promise != null) {
|
||||
|
||||
Reference in New Issue
Block a user