Find out an app's URL programmatically

只愿长相守 提交于 2019-12-06 14:13:32

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.

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];

check https://github.com/wujianguo/iOSAppsInfo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!