From 162aae03914e72980696034343cb581215d44531 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 14 Nov 2011 16:11:32 +0100 Subject: [PATCH] fix incomming call in bg mode --- Classes/LinphoneAppDelegate.m | 3 ++- Classes/PhoneViewController.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index b73da3f43..f4a172a23 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -144,7 +144,8 @@ } - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { - LinphoneCall* call = (LinphoneCall*)[notification.userInfo objectForKey:@"call"]; + LinphoneCall* call; + [(NSData*)([notification.userInfo objectForKey:@"call"]) getBytes:&call]; if (!call) { ms_warning("Local notification received with nil call"); return; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 243e5558d..214f9be66 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -247,7 +247,8 @@ notif.alertBody =[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]; notif.alertAction = @"Answer"; notif.soundName = @"oldphone-mono-30s.caf"; - notif.userInfo = [NSDictionary dictionaryWithObject:call forKey:"call"]; + NSData *callData = [NSData dataWithBytes:&call length:sizeof(call)]; + notif.userInfo = [NSDictionary dictionaryWithObject:callData forKey:@"call"]; [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; }