美文网首页
iOS URL Scheme

iOS URL Scheme

作者: 孔朝阳 | 来源:发表于2018-12-12 22:20 被阅读0次

一、唤起

唤起其他App最简单的方式

openURL

iOS10之后推荐使用如下API,可以传递参数并在唤起成功后收到回调

API

二、能唤起

判断是否能唤起

canOpenURL

iOS9引入了白名单的概念,如果使用 canOpenURL:方法,该方法所涉及到的 URL Schemes 必须在主工程中的Info.plist中被添加到白名单,否则不能使用。key:LSApplicationQueriesSchemes ,value:对应应用程序的URL Schemes。

LSApplicationQueriesSchemes

三、被唤起

被唤起App需配置URL Schemes

URL Schemes APPDelegate

App未启动时被唤起:

未启动

App后台中被唤起:

Tips:

1、LSApplicationQueriesSchemes中配置白名单最多50个

2、URL、URL Schemes、LSApplicationQueriesSchemes均不区分大小写

3、JS方法window.location.href需要调起App配置LSApplicationQueriesSchemes才能跳转

相关文章

网友评论

      本文标题:iOS URL Scheme

      本文链接:https://www.haomeiwen.com/subject/xoswcqtx.html