From 1d2343fa2e1b6609cfbd4985cbd3280e228f8ee9 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 6 Dec 2016 09:02:34 +0100 Subject: [PATCH] Fix repetition of UILocalNotif when app starts --- Classes/LinphoneAppDelegate.m | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 8258eafad..9434541e6 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -506,24 +506,25 @@ categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:set]; - UILocalNotification *notif = [[UILocalNotification alloc] init]; - if (notif) { - notif.repeatInterval = 0; + // UILocalNotification *notif = [[UILocalNotification alloc] init]; + if (notification) { + notification.repeatInterval = 0; if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) { #pragma deploymate push "ignored-api-availability" - notif.category = @"incoming_msg"; + notification.category = @"incoming_msg"; #pragma deploymate pop } if ([LinphoneManager.instance lpConfigBoolForKey:@"show_msg_in_notif" withDefault:YES]) { - notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_FULLMSG", nil), from, chat]; + notification.alertBody = + [NSString stringWithFormat:NSLocalizedString(@"IM_FULLMSG", nil), from, chat]; } else { - notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_MSG", nil), from]; + notification.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_MSG", nil), from]; } - notif.alertAction = NSLocalizedString(@"Show", nil); - notif.soundName = @"msg.caf"; - notif.userInfo = @{ @"from" : from, @"from_addr" : remote_uri, @"call-id" : callID }; - notif.accessibilityLabel = @"Message notif"; - [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; + notification.alertAction = NSLocalizedString(@"Show", nil); + notification.soundName = @"msg.caf"; + notification.userInfo = @{ @"from" : from, @"from_addr" : remote_uri, @"call-id" : callID }; + notification.accessibilityLabel = @"Message notif"; + [[UIApplication sharedApplication] presentLocalNotificationNow:notification]; } } else { UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];