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:
Jude Fernandes 2018-05-22 01:20:52 +05:30 committed by GitHub
parent 130321a27f
commit 6e095be2bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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) {