Skip to content

Commit 243fee1

Browse files
authored
readme: add note for should enabled capabilities in xcode
1 parent 303b39c commit 243fee1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Do-Not-Disturb / check if Ghost-Call / using some sip libs to register or waitin
4848
Staff from Apple gives some advisions for these issues in the below discussion:
4949
https://forums.developer.apple.com/thread/117939
5050

51-
#### you may need to change your server for APN voip push:
51+
#### You may need to change your server for APN voip push:
5252

53-
Especially `apns-push-type` value should be 'voip' for ios 13
53+
Especially `apns-push-type` value should be `'voip'` for iOS 13
5454
And be aware of `apns-expiration`value, adjust according to your call logics
5555

5656
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns
@@ -69,6 +69,10 @@ The iOS version should be >= 8.0 since we are using [PushKit][1].
6969

7070
Please refer to [VoIP Best Practices][2].
7171

72+
Make sure you enabled the folowing in `Xcode` -> `Signing & Capabilities`:
73+
* `Background Modes` -> `Voice over IP` enabled
74+
* `+Capability` -> `Push Notifications`
75+
7276
#### AppDelegate.m Modification
7377

7478
```objective-c
@@ -89,13 +93,13 @@ Please refer to [VoIP Best Practices][2].
8993

9094
/* Add PushKit delegate method */
9195

92-
// Handle updated push credentials
96+
// --- Handle updated push credentials
9397
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {
9498
// Register VoIP push token (a property of PKPushCredentials) with server
9599
[RNVoipPushNotificationManager didUpdatePushCredentials:credentials forType:(NSString *)type];
96100
}
97101

98-
// Handle incoming pushes (for ios <= 10)
102+
// --- Handle incoming pushes (for ios <= 10)
99103
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
100104
[RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
101105
}
@@ -125,19 +129,19 @@ Please refer to [VoIP Best Practices][2].
125129

126130
```
127131
128-
## Linking
132+
## Linking:
129133
130134
On RN60+, auto linking with pod file should work.
131135
Or you can try below:
132136
133137
## Linking Manually:
134138
135-
### Add PushKit Framework
139+
### Add PushKit Framework:
136140
137141
- In your Xcode project, select `Build Phases` --> `Link Binary With Libraries`
138142
- Add `PushKit.framework`
139143
140-
### Add RNVoipPushNotification
144+
### Add RNVoipPushNotification:
141145
142146
#### Option 1: Use [rnpm][3]
143147
@@ -155,7 +159,7 @@ rnpm link react-native-voip-push-notification
155159
3. Select `<your_xcode_project>` --> `Build Settings`
156160
- In `Header Search Paths`, add `$(SRCROOT)/../node_modules/react-native-voip-push-notification/ios/RNVoipPushNotification` with `recursive`
157161

158-
## Usage
162+
## Usage:
159163

160164
```javascript
161165

0 commit comments

Comments
 (0)