Commit af1eadf3 authored by yogevbd's avatar yogevbd

Updated docs

parent 17e31263
...@@ -20,15 +20,23 @@ Then, to enable notifications support add the following line at the top of your ...@@ -20,15 +20,23 @@ Then, to enable notifications support add the following line at the top of your
#import "RNNotifications.h" #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 ```objective-c
// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
{ [RNNotifications startMonitorNotifications]; // -> Add this line
[RNNotifications didRegisterUserNotificationSettings:notificationSettings];
return YES;
} }
```
And add the following methods to support registration:
```objective-c
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{ {
[RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; [RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
...@@ -38,16 +46,6 @@ And the following methods to support registration and receiving notifications: ...@@ -38,16 +46,6 @@ And the following methods to support registration and receiving notifications:
[RNNotifications didFailToRegisterForRemoteNotificationsWithError:error]; [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];
}
``` ```
## <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/APK_format_icon.png/768px-APK_format_icon.png" width=30/> Android ## <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/APK_format_icon.png/768px-APK_format_icon.png" width=30/> Android
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment