diff --git a/docs/installation.md b/docs/installation.md index 12e33d02f92935ae76e33dda9d687980e06d4de5..52ac148c0a928c464a09e35c0305c3499189e0cd 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