Skip to content

Commit 9a30069

Browse files
authored
readme: update report to callkit notes
1 parent 5698457 commit 9a30069

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ Make sure you enabled the folowing in `Xcode` -> `Signing & Capabilities`:
127127

128128
// --- NOTE: apple forced us to invoke callkit ASAP when we receive voip push
129129
// --- see: react-native-callkeep
130-
if (@available(iOS 13, *)) {
131-
// --- Retrieve information from your voip push payload
132-
NSString *uuid = payload.dictionaryPayload[@"uuid"];
133-
NSString *callerName = [NSString stringWithFormat:@"%@ (Connecting...)", payload.dictionaryPayload[@"callerName"]];
134-
NSString *handle = payload.dictionaryPayload[@"handle"];
135130

136-
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
137-
}
138-
131+
// --- Retrieve information from your voip push payload
132+
NSString *uuid = payload.dictionaryPayload[@"uuid"];
133+
NSString *callerName = [NSString stringWithFormat:@"%@ (Connecting...)", payload.dictionaryPayload[@"callerName"]];
134+
NSString *handle = payload.dictionaryPayload[@"handle"];
135+
136+
// --- You should make sure to report to callkit BEFORE execute `completion()`
137+
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
138+
139139
completion();
140140
}
141141
...

0 commit comments

Comments
 (0)