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
|
// public event name: onNotificationDisplayed
|
||||||
'notifications_notification_displayed',
|
'notifications_notification_displayed',
|
||||||
(notification: NativeNotification) => {
|
(notification: NativeNotification) => {
|
||||||
|
const rnNotification = new Notification(notification);
|
||||||
|
const done = (fetchResult: string) => getNativeModule(this).complete(rnNotification.notificationId, fetchResult);
|
||||||
SharedEventEmitter.emit(
|
SharedEventEmitter.emit(
|
||||||
'onNotificationDisplayed',
|
'onNotificationDisplayed',
|
||||||
new Notification(notification)
|
rnNotification,
|
||||||
|
done
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -200,10 +203,6 @@ export default class Notifications extends ModuleBase {
|
||||||
return getNativeModule(this).getScheduledNotifications();
|
return getNativeModule(this).getScheduledNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
complete(handlerId: string, fetchResult: string): Promise<void> {
|
|
||||||
return getNativeModule(this).complete(handlerId, fetchResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
onNotification(
|
onNotification(
|
||||||
nextOrObserver: OnNotification | OnNotificationObserver
|
nextOrObserver: OnNotification | OnNotificationObserver
|
||||||
): () => any {
|
): () => any {
|
||||||
|
|
Loading…
Reference in New Issue