Skip to content

Commit b3dd0b2

Browse files
committed
Add more field for pushkit playload.
1 parent ddef4ba commit b3dd0b2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

ios/Classes/CallKeep.m

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,30 @@ - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayloa
226226
/* payload example.
227227
{
228228
"callkeep": {
229-
"title": "Incoming Call",
230-
"number": "+86186123456789"
229+
"caller_id": "+8618612345678",
230+
"caller_name": "hello",
231+
"caller_id_type": "number",
232+
"has_video": false,
233+
},
234+
"extra": {
235+
"foo": "bar",
236+
"key": "value",
231237
}
232238
}
233239
*/
234240
NSDictionary *dic = payload.dictionaryPayload[@"callkeep"];
235-
NSString *number = dic[@"number"];
241+
NSString *number = dic[@"caller_id"];
242+
NSString *localizedCallerName = dic[@"caller_name"];
243+
BOOL hasVideo = [dic[@"has_video"] boolValue];
244+
NSString *handleType = dic[@"caller_id_type"];
245+
246+
//NSDictionary *extra = payload.dictionaryPayload[@"extra"];
247+
236248
[CallKeep reportNewIncomingCall:[self createUUID]
237249
handle:number
238-
handleType:@"number"
239-
hasVideo:NO
240-
localizedCallerName:@"hello"
250+
handleType:handleType
251+
hasVideo:hasVideo
252+
localizedCallerName:localizedCallerName
241253
fromPushKit:YES
242254
payload:payload.dictionaryPayload
243255
withCompletionHandler:^(){}];

0 commit comments

Comments
 (0)