Skip to content

chore(docs): Updated readme for APNs installation #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,33 @@ react-native link @react-native-community/push-notification-ios

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

### Update `AppDelegate.m`
### Add Capabilities : Background Mode - Remote Notifications

Go into your MyReactProject/ios dir and open MyProject.xcworkspace workspace.
Select the top project "MyProject" ans select the "Signing & Capabilities" tab.
Add a 2 new Capabilities using "+" button:
- `Background Mode` capability and tick `Remote Notifications`.
- `Push Notifications` capability


### Augment `AppDelegate`

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

### Update `AppDelegate.h`

At the top of the file:
```objective-c
#import <UserNotifications/UNUserNotificationCenter.h>
```

Then, add the 'UNUserNotificationCenterDelegate' to protocols:

```objective-c
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
```
### Update `AppDelegate.m`

At the top of the file:

```objective-c
Expand Down