[英]How to open installed iOS app by Using JavaScript?
I have developed an iOS app by using Adobe Flash CS6 and installed to iPad. 我已经通过使用Adobe Flash CS6开发了一个iOS应用并安装到iPad。 And it's running fine.
而且运行良好。 Now I want to open it from browser by clicking a button.
现在,我想通过单击按钮从浏览器中打开它。 The app name: MyRadio id is: com.radio.MyRadio
应用名称:MyRadio ID为:com.radio.MyRadio
I have used the following codes on click a button: 1. setTimeout(function () { window.location = " https://itunes.apple.com/appdir "; }, 25); 我在单击按钮时使用了以下代码:1. setTimeout(function(){window.location =“ https://itunes.apple.com/appdir”;},25 ); window.location = "MyRadio://";
window.location =“ MyRadio://”;
2. window.open("MyRadio://","_self"); 2. window.open(“ MyRadio://”,“ _self”);
3. window.location = "MyRadio://"; 3. window.location =“ MyRadio://”;
4. Lanch App 4.启动应用
I tried all the above 4 different types of code. 我尝试了以上所有4种不同类型的代码。 But no one is working.
但是没有人在工作。 Could you please help me to solve this problem so that I can launch my app by click a button from html page.
您能否帮助我解决此问题,以便我可以通过单击html页面中的按钮来启动我的应用程序。 Please let me know if I am missing anything.
如果我有任何遗漏,请告诉我。
Thanks all. 谢谢大家
You need to register your custom URL scheme. 您需要注册您的自定义URL方案。 Please refer Launching Your iPhone App Via Custom URL Scheme for more info.
有关更多信息,请参考通过自定义URL方案启动iPhone应用程序 。
The relevant part of the process from Apple's documentation is: Apple文档中过程的相关部分是:
Registering Custom URL Schemes
注册自定义URL方案
To register a URL type for your app, include the
CFBundleURLTypes
key in your app'sInfo.plist
file.要为您的应用程序注册URL类型,请在应用程序的
Info.plist
文件中包含CFBundleURLTypes
键。 TheCFBundleURLTypes
key contains an array of dictionaries, each of which defines a URL scheme the app supports.CFBundleURLTypes
键包含一个字典数组,每个字典都定义了应用程序支持的URL方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.