Tapping on message and missed call notification with app not started navigation

This commit is contained in:
Christophe Deschamps 2024-02-13 13:25:13 +01:00
parent d70c60d5fa
commit b5f9daba55
3 changed files with 13 additions and 1 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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.