打开本机应用程序.来自 Safari [英] Opening Native App. from Safari

查看:25
本文介绍了打开本机应用程序.来自 Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 iPhone 应用程序.像沙箱一样运行.这意味着他们无权访问其他应用程序的文件.而且我还设法从本机应用程序()使用以下方法在 Safari 中打开了一个网站:

I know iPhone apps. operate like sandboxes. Meaning that they don't have access to other apps' files. And I have also managed to open a website in Safari from a Native App() using:

 openURL:[NSURL URLWithString: Website_Address] 

我看到有四个本地应用程序是从 safari 打开的.

There are four Native apps that I have seen being opened from safari.

  1. 应用商店应用
  2. 地图应用
  3. 电子邮件应用
  4. 手机应用

有没有办法从 Safari 中的 iphone 网站打开我自己的应用程序(可能是一些 html/xml/php 等代码)?

Is there a method of opening my own app from an iphone website in Safari(maybe some html/xml/php etc code)?

推荐答案

是,可以通过将应用程序绑定到自定义URI方案,然后使用自定义URI方案创建链接,选择,将打开您的应用程序.

Yes, you can do this by binding your application to a custom URI scheme and then creating a link with your custom URI scheme which, when selected, will open your app.

要注册自定义 URI 方案,您需要修改 info.plist 文件并将您的自定义值分配给 URL Identifier 对象.

To register the custom URI scheme you'll need to modify the info.plist file and assign your custom value to the URL Identifier object.

您可以查看iPhone 操作系统编程指南 Apple 开发人员文档了解更多详情或 这篇文章,其中详细介绍了分步过程.

You can review the iPhone OS Programming Guide Apple developer documentation for further details or this article which details the step-by-step process in-depth.

或者你可以查看来自 Apple 的官方文档.

这篇关于打开本机应用程序.来自 Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆