diff --git a/lib/modules/notifications/index.js b/lib/modules/notifications/index.js index f472d79c..2f2db9c9 100644 --- a/lib/modules/notifications/index.js +++ b/lib/modules/notifications/index.js @@ -89,9 +89,12 @@ export default class Notifications extends ModuleBase { // public event name: onNotificationDisplayed 'notifications_notification_displayed', (notification: NativeNotification) => { + const rnNotification = new Notification(notification); + const done = (fetchResult: string) => getNativeModule(this).complete(rnNotification.notificationId, fetchResult); SharedEventEmitter.emit( 'onNotificationDisplayed', - new Notification(notification) + rnNotification, + done ); } ); @@ -200,10 +203,6 @@ export default class Notifications extends ModuleBase { return getNativeModule(this).getScheduledNotifications(); } - complete(handlerId: string, fetchResult: string): Promise { - return getNativeModule(this).complete(handlerId, fetchResult); - } - onNotification( nextOrObserver: OnNotification | OnNotificationObserver ): () => any {