diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m index af17ea49791..b29acfd80e8 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m @@ -432,7 +432,12 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction [launchOptions setObject:[url absoluteString] forKey:@"url"]; [launchOptions removeObjectForKey:UIApplicationLaunchOptionsSourceApplicationKey]; - [launchOptions setObject:[options objectForKey:UIApplicationOpenURLOptionsSourceApplicationKey] ?: [NSNull null] forKey:@"source"]; + id source = [options objectForKey:UIApplicationOpenURLOptionsSourceApplicationKey]; + if (source != nil) { + [launchOptions setObject:source forKey:@"source"]; + } else { + [launchOptions removeObjectForKey:@"source"]; + } if (appBooted) { [[NSNotificationCenter defaultCenter] postNotificationName:kTiApplicationLaunchedFromURL object:self userInfo:launchOptions]; @@ -453,7 +458,11 @@ - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceAppl [launchOptions setObject:[url absoluteString] forKey:@"url"]; [launchOptions removeObjectForKey:UIApplicationLaunchOptionsSourceApplicationKey]; - [launchOptions setObject:sourceApplication ?: [NSNull null] forKey:@"source"]; + if (sourceApplication != nil) { + [launchOptions setObject:sourceApplication forKey:@"source"]; + } else { + [launchOptions removeObjectForKey:@"source"]; + } if (appBooted) { [[NSNotificationCenter defaultCenter] postNotificationName:kTiApplicationLaunchedFromURL object:self userInfo:launchOptions];