获取任何 iOS 应用程序的完整自定义 URL 方案和路径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12767218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Get full custom URL scheme & path for any iOS application
提问by gbtv
I followed the instructions here:
我按照这里的说明操作:
How can I extract the Custom URL Scheme from a .ipa file?
And was able to get the main URL scheme. For example, for the Hulu Application I got:
并且能够获得主要的 URL 方案。例如,对于 Hulu 应用程序,我得到了:
"hulu://"
“葫芦://”
But I actually want to figure out how to get the remaining information so that I can directly link into the Hulu Application to a particular video. I know for Hulu that the URL scheme is this:
但我实际上想弄清楚如何获取剩余信息,以便我可以直接将 Hulu 应用程序链接到特定视频。我知道 Hulu 的 URL 方案是这样的:
"hulu://w/id number for video"
“hulu://w/视频 ID 号”
But i was only able to get this by going to the Hulu site and seeing them redirect me using the above scheme. Is there any way to figure out the full scheme by using the .ipa file or anything else?
但是我只能通过访问 Hulu 网站并看到他们使用上述方案重定向我才能获得此信息。有没有办法通过使用 .ipa 文件或其他任何东西来找出完整的方案?
There are 7 or 8 apps that I am trying to get the scheme for. The first part is easy, the 2nd part is hard.
我正在尝试获取 7 或 8 个应用程序的方案。第一部分很容易,第二部分很难。
回答by Emil
If you don't need to do it programmatically, you can simply search up the applications on http://handleopenurl.com/– they have a great list over URL schemes. The wiki http://wiki.akosma.com/IPhone_URL_Schemesalso has a comprehensive list.
如果您不需要以编程方式进行,您可以简单地在http://handleopenurl.com/上搜索应用程序——它们有一个很好的 URL 方案列表。wiki http://wiki.akosma.com/IPhone_URL_Schemes也有一个完整的列表。
When developers make their custom URL schemes, they only register the base scheme (hulu://
), and they later split and match the URL programmatically. See below example:
当开发人员制作他们的自定义 URL 方案时,他们只注册基本方案 ( hulu://
),然后他们以编程方式拆分和匹配 URL。见下面的例子:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
NSLog(@"url recieved: %@", url);
NSLog(@"query string: %@", [url query]);
NSLog(@"host: %@", [url host]);
NSLog(@"url path: %@", [url path]);
NSDictionary *dict = [self parseQueryString:[url query]];
NSLog(@"query dict: %@", dict);
return YES;
}
When compiled, the code revealing the steps become unreadable, so you can no longer extract that informataion, which in turn doesn't help you much. I suggest you contact the developers of the apps in question, they have full insight in these schemes!
编译后,显示步骤的代码变得不可读,因此您无法再提取该信息,这反过来对您没有多大帮助。我建议您联系相关应用程序的开发人员,他们对这些方案有充分的了解!
回答by FD_
The full scheme resolution is done in the code (handleOpenURL in the AppDelegate), which is no more readable after compilation, so you won't be able to get it from the IPA.
完整的scheme解析是在代码中完成的(AppDelegate中的handleOpenURL),编译后不再可读,所以无法从IPA中获取。
There are some lists of app url schemes:
有一些应用程序 url 方案列表:
..but none of them gives hints about hulu. Contacting the developer might be the best solution, here.
..但他们都没有给出关于 hulu 的提示。联系开发人员可能是最好的解决方案,在这里。
Hope this helps.
希望这可以帮助。