From c0cc822f474b1f5a999ea4b78094049c960330f9 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Thu, 11 Apr 2019 12:02:56 +0200 Subject: [PATCH] fix clear local call notifiation error --- Classes/LinphoneAppDelegate.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 62f113a64..94c19af0e 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -643,9 +643,13 @@ linphone_call_set_authentication_token_verified(call, NO); } else if ([response.actionIdentifier isEqual:@"Call"]) { return; - } else { // in this case the value is : com.apple.UNNotificationDefaultActionIdentifier + } else { // in this case the value is : com.apple.UNNotificationDefaultActionIdentifier or com.apple.UNNotificationDismissActionIdentifier if ([response.notification.request.content.categoryIdentifier isEqual:@"call_cat"]) { - [PhoneMainView.instance displayIncomingCall:call]; + if ([response.actionIdentifier isEqualToString:@"com.apple.UNNotificationDismissActionIdentifier"]) + // clear notification + linphone_call_decline(call, LinphoneReasonDeclined); + else + [PhoneMainView.instance displayIncomingCall:call]; } else if ([response.notification.request.content.categoryIdentifier isEqual:@"msg_cat"]) { NSString *peer_address = [response.notification.request.content.userInfo objectForKey:@"peer_addr"]; NSString *local_address = [response.notification.request.content.userInfo objectForKey:@"local_addr"];