inject onNotificationDisplayed with completion handler
This commit is contained in:
parent
e6cd793f91
commit
b6885b0125
|
@ -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<void> {
|
||||
return getNativeModule(this).complete(handlerId, fetchResult);
|
||||
}
|
||||
|
||||
onNotification(
|
||||
nextOrObserver: OnNotification | OnNotificationObserver
|
||||
): () => any {
|
||||
|
|
Loading…
Reference in New Issue