简体   繁体   English

如何使用JavaScript打开已安装的iOS应用?

[英]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's Info.plist file. 要为您的应用程序注册URL类型,请在应用程序的Info.plist文件中包含CFBundleURLTypes键。 The CFBundleURLTypes 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.

相关问题 如何使用 JavaScript 判断应用程序是否安装在 ios 设备上? - How to tell if an app is installed on an ios device using JavaScript? Javascript 从浏览器检查应用程序是否已安装或打开应用程序(ios) - Javascript to check from browser if app is installed or open app (ios) 使用javascript(无意图)打开移动应用(如果已安装) - Open mobile app (if installed) using javascript (without intent) 如何使用javascript安装或不安装应用程序 - How to check app is installed or not using javascript 如果在 iOS 9+ 上的 Safari 中的手机上安装了应用程序,如何从 Javascript 检查? - How to check from Javascript if an app is installed on the phone in Safari on iOS 9+? 如何使用自定义协议打开应用程序,否则如果未安装则下载? - How to open app using custom protocol otherwise download if not installed? 如果已安装则打开应用程序,否则发送下载-Javascript - Open app if installed else send to download - Javascript 检测是否已在Java中使用JavaScript安装了应用 - Detect if an app has been installed on iOS in JavaScript 使用jQuery和Javascript打开IOS相机应用并将其存储为变量 - Using jQuery and Javascript to open the IOS camera app and store it as a variable 如何使用JavaScript打开已保存的Web应用程序? - How to open saved web app using JavaScript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM