From 5689d702e4ecd036470fa1672dba87c5c5cab407 Mon Sep 17 00:00:00 2001 From: Ryan Grey Date: Wed, 15 Aug 2018 11:51:35 +0100 Subject: [PATCH] Update ts/flow types CompletionHandler is no longer passed as a param to listener. Instead it exists on the IOSNotification class. --- src/index.d.ts | 3 ++- src/modules/notifications/index.js | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index a477009b..ed5216ac 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1168,7 +1168,7 @@ declare module 'react-native-firebase' { ): () => any; onNotificationDisplayed( - listener: (notification: Notification, done: CompletionHandler) => any + listener: (notification: Notification) => any ): () => any; onNotificationOpened( @@ -1473,6 +1473,7 @@ declare module 'react-native-firebase' { hasAction?: boolean; launchImage?: string; threadIdentifier?: string; + complete?: CompletionHandler; addAttachment( identifier: string, diff --git a/src/modules/notifications/index.js b/src/modules/notifications/index.js index 101fd14c..ec33c181 100644 --- a/src/modules/notifications/index.js +++ b/src/modules/notifications/index.js @@ -12,9 +12,7 @@ import AndroidAction from './AndroidAction'; import AndroidChannel from './AndroidChannel'; import AndroidChannelGroup from './AndroidChannelGroup'; import AndroidNotifications from './AndroidNotifications'; -import IOSNotifications, { - type BackgroundFetchResultValue, -} from './IOSNotifications'; +import IOSNotifications from './IOSNotifications'; import AndroidRemoteInput from './AndroidRemoteInput'; import Notification from './Notification'; import { @@ -36,9 +34,7 @@ import type { Schedule, } from './types'; -type CompletionHandler = BackgroundFetchResultValue => void; - -type OnNotification = (Notification, CompletionHandler) => any; +type OnNotification = Notification => any; type OnNotificationObserver = { next: OnNotification,