diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index ea60614f0..78df2f3fe 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -282,7 +282,6 @@ intentIdentifiers:[[NSMutableArray alloc] init] options:UNNotificationCategoryOptionCustomDismissAction]; - [UNUserNotificationCenter currentNotificationCenter].delegate = self; NSSet *categories = [NSSet setWithObjects:cat_call, cat_msg, video_call, cat_zrtp, nil]; [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:categories]; @@ -295,6 +294,7 @@ [FIRApp configure]; #endif + [UNUserNotificationCenter currentNotificationCenter].delegate = self; if ([VFSUtil vfsEnabledWithGroupName:kLinphoneMsgNotificationAppGroupId]) { if (TARGET_IPHONE_SIMULATOR) { @@ -611,6 +611,15 @@ withCompletionHandler:(void (^)(void))completionHandler { LOGD(@"UN : response received"); LOGD(response.description); + + if (![response.actionIdentifier isEqualToString:@"com.apple.UNNotificationDismissActionIdentifier"] && + [response.notification.request.content.userInfo objectForKey:@"missed_call"]) { + [PhoneMainView.instance changeCurrentView:VIEW(HistoryListView).compositeViewDescription]; + [PhoneMainView.instance.mainViewController didRotateFromInterfaceOrientation:PhoneMainView.instance.mainViewController.currentOrientation]; + return; + } + + startedInBackground = true; NSString *callId = (NSString *)[response.notification.request.content.userInfo objectForKey:@"CallId"]; if (!callId) diff --git a/Classes/LinphoneUI/UICompositeView.m b/Classes/LinphoneUI/UICompositeView.m index 037bc2714..eb5a836fd 100644 --- a/Classes/LinphoneUI/UICompositeView.m +++ b/Classes/LinphoneUI/UICompositeView.m @@ -408,6 +408,8 @@ sideMenu:(NSNumber *)sideMenu fullscreen:(NSNumber *)fullscreen { + currentOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; + UIViewController *oldMainViewController = self.mainViewController; UIViewController *oldDetailsViewController = self.detailsViewController; UIViewController *oldStatusBarViewController = self.statusBarViewController; diff --git a/Classes/Swift/CallManager.swift b/Classes/Swift/CallManager.swift index 6e5eb2de5..f089245bd 100644 --- a/Classes/Swift/CallManager.swift +++ b/Classes/Swift/CallManager.swift @@ -684,6 +684,7 @@ import AVFoundation let content = UNMutableNotificationContent() content.title = NSString.localizedUserNotificationString(forKey: NSLocalizedString("Missed call", comment: ""), arguments: nil) content.body = NSString.localizedUserNotificationString(forKey: displayName, arguments: nil) + content.userInfo = ["missed_call" : true] // Deliver the notification. let request = UNNotificationRequest(identifier: "call_request", content: content, trigger: nil) // Schedule the notification.