diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a4cf5a0..c9f6e0849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Group changes to describe their impact on the project, as follows: - Fix invalid photo rotation when using Camera for avatars - Parse user input as SIP address or phone number depending on default account settings: if "substitute + by country code" is set, consider inputs to be phone numbers, otherwise SIP addresses. +- Automatically start call when answering from within notification in iOS9+ ## [3.12.1] - 2016-02-19 diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 81411b5b2..02b0f6f1f 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -465,7 +465,17 @@ withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler { - if ([notification.category isEqualToString:@"incoming_msg"] && [identifier isEqualToString:@"reply_inline"]) { + if ([notification.category isEqualToString:@"incoming_call"]) { + if ([identifier isEqualToString:@"answer"]) { + // use the standard handler + [self application:application didReceiveLocalNotification:notification]; + } else if ([identifier isEqualToString:@"decline"]) { + LinphoneCall *call = linphone_core_get_current_call(LC); + if (call) + linphone_core_decline_call(LC, call, LinphoneReasonDeclined); + } + } else if ([notification.category isEqualToString:@"incoming_msg"] && + [identifier isEqualToString:@"reply_inline"]) { LinphoneCore *lc = [LinphoneManager getLc]; NSString *replyText = [responseInfo objectForKey:UIUserNotificationActionResponseTypedTextKey]; NSString *from = [notification.userInfo objectForKey:@"from_addr"]; @@ -477,6 +487,7 @@ [PhoneMainView.instance updateApplicationBadgeNumber]; } } + completionHandler(); } - (void)application:(UIApplication *)application