forked from mirrors/linphone-iphone
Open call view when answer call notif
This commit is contained in:
parent
10a902a591
commit
a2cd295b8b
1 changed files with 2 additions and 1 deletions
|
|
@ -489,7 +489,7 @@ didInvalidatePushTokenForType:(NSString *)type {
|
||||||
LOGI(@"incoming voip notfication: %@ ", payload.dictionaryPayload);
|
LOGI(@"incoming voip notfication: %@ ", payload.dictionaryPayload);
|
||||||
if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) {
|
if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) {
|
||||||
//Call category
|
//Call category
|
||||||
UNNotificationAction* act_ans = [UNNotificationAction actionWithIdentifier:@"Answer" title:@"Answer" options:UNNotificationActionOptionNone];
|
UNNotificationAction* act_ans = [UNNotificationAction actionWithIdentifier:@"Answer" title:@"Answer" options:UNNotificationActionOptionForeground];
|
||||||
UNNotificationAction* act_dec = [UNNotificationAction actionWithIdentifier:@"Decline" title:@"Decline" options:UNNotificationActionOptionNone];
|
UNNotificationAction* act_dec = [UNNotificationAction actionWithIdentifier:@"Decline" title:@"Decline" options:UNNotificationActionOptionNone];
|
||||||
UNNotificationCategory* cat_call = [UNNotificationCategory categoryWithIdentifier:@"call_cat" actions:[NSArray arrayWithObjects:act_ans, act_dec, nil] intentIdentifiers:[[NSMutableArray alloc] init] options:UNNotificationCategoryOptionCustomDismissAction];
|
UNNotificationCategory* cat_call = [UNNotificationCategory categoryWithIdentifier:@"call_cat" actions:[NSArray arrayWithObjects:act_ans, act_dec, nil] intentIdentifiers:[[NSMutableArray alloc] init] options:UNNotificationCategoryOptionCustomDismissAction];
|
||||||
|
|
||||||
|
|
@ -542,6 +542,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ([response.actionIdentifier isEqual:@"Answer"]) {
|
if ([response.actionIdentifier isEqual:@"Answer"]) {
|
||||||
|
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
|
||||||
[LinphoneManager.instance acceptCallForCallId:[response.notification.request.content.userInfo objectForKey:@"callId"]];
|
[LinphoneManager.instance acceptCallForCallId:[response.notification.request.content.userInfo objectForKey:@"callId"]];
|
||||||
} else if ([response.actionIdentifier isEqual:@"Decline"]) {
|
} else if ([response.actionIdentifier isEqual:@"Decline"]) {
|
||||||
linphone_core_decline_call(LC, call, LinphoneReasonDeclined);
|
linphone_core_decline_call(LC, call, LinphoneReasonDeclined);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue