Skip to content

Commit c8c350d

Browse files
authored
chore(docs): Updated readme for APNs installation (#93)
1 parent bf19cc1 commit c8c350d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,33 @@ react-native link @react-native-community/push-notification-ios
4545

4646
If you don't want to use the methods above, you can always [link the library manually](./docs/manual-linking.md).
4747

48-
### Update `AppDelegate.m`
48+
### Add Capabilities : Background Mode - Remote Notifications
49+
50+
Go into your MyReactProject/ios dir and open MyProject.xcworkspace workspace.
51+
Select the top project "MyProject" ans select the "Signing & Capabilities" tab.
52+
Add a 2 new Capabilities using "+" button:
53+
- `Background Mode` capability and tick `Remote Notifications`.
54+
- `Push Notifications` capability
55+
56+
57+
### Augment `AppDelegate`
4958

5059
Finally, to enable support for `notification` and `register` events you need to augment your AppDelegate.
5160

61+
### Update `AppDelegate.h`
62+
63+
At the top of the file:
64+
```objective-c
65+
#import <UserNotifications/UNUserNotificationCenter.h>
66+
```
67+
68+
Then, add the 'UNUserNotificationCenterDelegate' to protocols:
69+
70+
```objective-c
71+
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
72+
```
73+
### Update `AppDelegate.m`
74+
5275
At the top of the file:
5376
5477
```objective-c

0 commit comments

Comments
 (0)