美文网首页
iOS URL Scheme 深链接

iOS URL Scheme 深链接

作者: 你飞跃俊杰 | 来源:发表于2021-10-14 15:36 被阅读0次

一、设置

1.设置info文件创建URL types
2.targets-info的URL types
两者会同步

二、说明

URL identifier 名字,避免与其他冲突
URL Schemes 是一个数组,可以一次性加多个,不区分大小写(系统的是prefs)

三、打开方式

直接

NSString *scheme = @"schemedemo://?parameter2=openScheme";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:scheme]];

四、UniversalLink深链接

在连接下配置对应的文件

{
 "applinks": {
 "apps": [],
 "details": [
 { "appID": "teamid.identify",
 "paths": [ "*" ]}
 ]
 }
}

设置深链接的跨域保护
用safari打开对应地址,下来看看是不是有对应的app图标,有表示设置成功

五、网页

浏览器能打开app的地址
xxxapp://
微信内能打开的地址
https://unilinks.com/app_download/iphonelinks/xxxtapp/

相关文章

网友评论

      本文标题:iOS URL Scheme 深链接

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