get all iOS url schemes on device

大憨熊 提交于 2019-12-03 08:19:48

问题


Is there a way to get all the url schemes of all the apps on a device? There has to be a central repository of them somewhere, maybe a plist?


回答1:


Adding my solution in case someone is still looking. After spending some time researching the answer, I finished off on a mix between @danielbeard's and @Avis' solution.

Because I know what application I am looking for:

  1. Download the .ipa from iTunes using my computer
  2. Copy the application to my desktop
  3. Rename it to *.zip
  4. Extract the *.zip
  5. Open the 'Payload' folder
  6. Right click on the application and select 'Show Package Contents'
  7. I then double-click the 'Info.plist' file (which Xcode should then open)
  8. Then check 'URL types' > 'Item 0' > 'URL Schemes'

Using that information I then add it to an array of apps to check (doing what @danielbeard suggested).

Hope this helps someone in the future.




回答2:


if it's programatically, i don't know.

here is answer to related to your question(not exactly)

Find out an app's URL programmatically

But manually, on your device-

yes...

there is a way to get url schemes of all apps on your device by this procedure. Install ifunbox on your system. Connect your device, open user applications and open the app that you are trying to find url scheme. you will find app home folder, in that folder you will find info.plist of that app. open info.plist and check url scheme address in the last column.

it worked for me. you will find url scheme of some apps which are registered for url schemes.

here are some some links for url scheme addresses of some apps.(might save your time).

1.http://handleopenurl.com/ 2.http://wiki.akosma.com/IPhone_URL_Schemes




回答3:


Yes, you can use private api. First

@interface PrivateApi_LSApplicationWorkspace
- (NSArray*)privateURLSchemes;
- (NSArray*)publicURLSchemes;
@end

then use it:

PrivateApi_LSApplicationWorkspace* _workspace;
_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];
- (NSArray*)privateURLSchemes
{
    return [_workspace privateURLSchemes];
}

- (NSArray*)publicURLSchemes
{
    return [_workspace publicURLSchemes];
}

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




回答4:


I'm going to go out on a whim here and assume you are trying to do the following:

  1. You have a PDF in your app.
  2. You want to check (programmatically) to see if any other app can open PDF files.
  3. If so, open PDF using that app.

If you want to do this, you don't have to do step 2 manually. As a matter of fact, you can't. However, you can use the UIDocumentInteractionController class to present a menu of compatible apps.

This is the only way you can "check" for other apps installed on the phone. At least on iOS 7 and under.




回答5:


It's not supported officially by Apple API without jailbreaking

A workaround might be how Bump knows which apps are launched and support URL Schemes: http://danielamitay.com/blog/2011/2/16/how-to-detect-installed-ios-apps



来源:https://stackoverflow.com/questions/25672362/get-all-ios-url-schemes-on-device

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