From 581dccc7a8c201949f5477088829ff062d8d397f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 2 Oct 2012 17:05:14 +0200 Subject: [PATCH] set bg mode by default --- Classes/LinphoneAppDelegate.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index e739de4a0..47d7dd61d 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -146,6 +146,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound |UIRemoteNotificationTypeBadge]; + //work around until we can access lpconfig without linphonecore + NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: + @"YES", @"start_at_boot_preference", + @"YES", @"backgroundmode_preference", + nil]; + [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; + if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] && [UIApplication sharedApplication].applicationState == UIApplicationStateBackground && (![[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"] ||