[TIMOB-14966] iOS: "Open In" doesn't catch source App when App is already launched (resuming)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Antonio Vila |
Assignee | Unknown |
Created | 2013-08-26T09:53:56.000+0000 |
Updated | 2018-02-28T20:03:59.000+0000 |
Description
Current code only gets URL and "handleOpenURL" is obsolete:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
[launchOptions removeObjectForKey:UIApplicationLaunchOptionsURLKey];
[launchOptions setObject:[url absoluteString] forKey:@"url"];
return YES;
}
openURL will do the work!
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
[launchOptions removeObjectForKey:UIApplicationLaunchOptionsURLKey];
[launchOptions setObject:[url absoluteString] forKey:@"url"];
[launchOptions removeObjectForKey:UIApplicationLaunchOptionsSourceApplicationKey];
[launchOptions setObject:sourceApplication forKey:@"source"];
return YES;
}
Hi Antonio, Please can you provide a JavaScript test case that we can drop into an app.js and run? Also, some steps to reproduce would be helpful (for example, I'm not sure off the top of my head where you would access the "Open In" option) Thanks!
It is quite simple: var queryString = Ti.App.getArguments().url; var sourceApp = Ti.App.getArguments().source; Ti.Api.info(sourceApp); Regardless of the previous sample, the recommended way to obtain source and URL is openUrl (https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:openURL:sourceApplication:annotation:). handleOpenURL is deprecated.