From cd2038d567092836b5deaf9100536fe4ca63d115 Mon Sep 17 00:00:00 2001 From: Hans Govind Date: Wed, 20 Dec 2017 16:11:34 +0200 Subject: [PATCH 1/2] Make sure to import PushNotificationIOS from react-native first --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d6fcda856..5807bbebe 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ public class MainApplication extends Application implements ReactApplication { ## Usage ```javascript +import { PushNotificationIOS } from 'react-native'; var PushNotification = require('react-native-push-notification'); PushNotification.configure({ @@ -141,7 +142,7 @@ PushNotification.configure({ console.log( 'NOTIFICATION:', notification ); // process the notification - + // required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html) notification.finish(PushNotificationIOS.FetchResult.NoData); }, From d33323b51699a4d038b5cbe7a07227b40fd7bf5b Mon Sep 17 00:00:00 2001 From: Boris Tacyniak Date: Thu, 7 May 2020 21:10:33 +0200 Subject: [PATCH 2/2] Change the documentation of onNotification. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34f7c27b6..98bea8b8f 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ PushNotification.configure({ console.log("TOKEN:", token); }, - // (required) Called when a remote or local notification is opened or received + // (required) Called when a remote is received in foreground or opened, or local notification is opened onNotification: function (notification) { console.log("NOTIFICATION:", notification);