Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-notifications
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
冷佳娟
react-native-notifications
Commits
af1eadf3
Commit
af1eadf3
authored
Jul 11, 2019
by
yogevbd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated docs
parent
17e31263
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
docs/installation.md
docs/installation.md
+13
-15
No files found.
docs/installation.md
View file @
af1eadf3
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment