From af1eadf3b9ca6a8643c13377f97aa167340984d6 Mon Sep 17 00:00:00 2001 From: yogevbd Date: Thu, 11 Jul 2019 13:47:44 +0300 Subject: [PATCH] Updated docs --- docs/installation.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 12e33d0..52ac148 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -20,15 +20,23 @@ Then, to enable notifications support add the following line at the top of your #import "RNNotifications.h" ``` -And the following methods to support registration and receiving notifications: +Start monitor notifications in: `application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions` ```objective-c -// Required to register for notifications -- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings -{ - [RNNotifications didRegisterUserNotificationSettings:notificationSettings]; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [RNNotifications startMonitorNotifications]; // -> Add this line + + return YES; } +``` + + +And add the following methods to support registration: + +```objective-c + - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; @@ -38,16 +46,6 @@ And the following methods to support registration and receiving notifications: [RNNotifications didFailToRegisterForRemoteNotificationsWithError:error]; } -// Required for the notification event. -- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification { - [RNNotifications didReceiveRemoteNotification:notification]; -} - -// Required for the localNotification event. -- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification -{ - [RNNotifications didReceiveLocalNotification:notification]; -} ``` ## Android -- 2.26.2