iOS URL Scheme 深链接

2021-10-14  本文已影响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/

上一篇 下一篇

猜你喜欢

热点阅读