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

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

问题描述

我知道iPhone应用程序。像沙箱一样操作。这意味着他们无法访问其他应用程序的文件。我还设法在本地应用程序()中使用以下方式在Safari中打开一个网站:

  openURL:[NSURL URLWithString:Website_Address ] 

我看到有四款本地应用正在从Safari浏览器打开。


  1. App Store应用程序

  2. 地图应用程序

  3. 电子邮件应用程序




  4. 有没有一种方法可以在Safari中的iPhone网站上打开我自己的应用程序(也许有些HTML / xml / php等代码)?

    解决方案

    是的,您可以通过将您的应用程序绑定到自定义URI方案,然后创建一个与您的自定义URI方案的链接,当您选择时,它将打开您的应用程序。



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



    您可以查看 iPhone OS编程指南苹果开发者文档获取更多细节或这篇文章详细介绍了详细的分步过程。



    或者你可以查看 Apple官方文档


    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] 
    

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

    1. App Store app
    2. Maps app
    3. Email app
    4. Phone app

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

    解决方案

    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.

    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.

    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.

    Or you can check out the official documentation from Apple.

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

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