适用于iOS浏览器协议处理程序选项 [英] Browser protocol handler options for ios

查看:116
本文介绍了适用于iOS浏览器协议处理程序选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过浏览器协议处理我的意思是spotifiy://和结尾://

By browser protocol handler I mean spotifiy:// and coda://.

有关iOS的Safari浏览器有哪些选项。我可以指定为BPH保管箱或Evernote的,浏览器会知道提示开放项目中的Evernote,例如?

What options exist for iOS safari. Could I specify a BPH for dropbox or evernote and the browser would know to prompt "open item in evernote" for example?

这可能吗?

推荐答案

您可以使用 - [UIApplication的的OpenURL:] 打开任意URL。如果另一个应用程序已注册的协议方案,便会处理的URL。同样有 - [UIApplication的canOpenURL:] 来找出是否一个URL方案可以尝试调用它之前进行处理。但是请注意,当你打开一个URL OS不提示用户,它只是推出,因此目前注册为该URL方案的应用程序,并给他们的网址。如果要提示用户在这之前,你应该这样做你自己。

You can use -[UIApplication openURL:] to open an arbitrary URL. If another app has registered for the protocol scheme, they will then handle the URL. Similarly there's -[UIApplication canOpenURL:] to find out if a URL scheme can be handled before you attempt to invoke it. Note however, the OS does not prompt the user when you open a URL, it simply launches the app that's currently registered for that URL scheme and gives them the URL. If you want to prompt the user before this happens, you should do so yourself.

这篇关于适用于iOS浏览器协议处理程序选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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