I need to launch another app from within my own app, but I don't have its URL. So my question is: Is there a way to find out another app's url programmatically based on its bundle identifier, or trackid?
Asked
Active
Viewed 7,478 times
2
-
what you want " launch another app ?" can you elaborate it ? – iPatel Mar 13 '14 at 13:51
-
I need to launch another app from within my own app – Leonardo Mar 13 '14 at 14:04
-
If you know the app at compile time you should also know the scheme at compile time – Marc Mar 13 '14 at 14:07
-
That's my problem, I don't know the app, I'm receveing information on what app to open from a server. – Leonardo Mar 13 '14 at 14:10
-
Do you have any assurance that the app you want to open is even installed on your user's device? What should happen in case it's not? – Alex Basson Nov 16 '15 at 03:01
-
No, I didn't have any assurance the app was installed. I ended up just using a store kit popover which has an `open` button, and when the app is not installed, it just gives the user the option to install it – Leonardo Nov 16 '15 at 11:08
2 Answers
3
If you just want to launch other apps, you can use ios private api.
@interface PrivateApi_LSApplicationWorkspace
- (bool)openApplicationWithBundleID:(id)arg1; //LSApplicationWorkspace
- (NSArray*)privateURLSchemes; //LSApplicationWorkspace
- (NSArray*)publicURLSchemes;
@end
PrivateApi_LSApplicationWorkspace* _workspace;
_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];
[_workspace openApplicationWithBundleID:bundleIdentifier];
NSArray* privateUrls = [_workspace privateURLSchemes];
NSArray* publicUrls = [_workspace publicURLSchemes];

justin
- 231
- 2
- 8
2
No, there is no way to determine an app's custom URL scheme programmatically. An app's custom scheme, if there even is one, can be completely unrelated to anything else you may know about the app.
The only way to determine the scheme is to access the app's Info.plist file, and unless you are on a jailbroken device, this can't be done at runtime.

rmaddy
- 314,917
- 42
- 532
- 579