一、微信、qq等自帶瀏覽器無法進(jìn)行app之間的跳轉(zhuǎn)
iOS9以后出來了通用鏈接跳轉(zhuǎn),效果可以看網(wǎng)易新聞、今日頭條等,右上角會(huì)出來一個(gè)url鏈接

1、項(xiàng)目的配置
?1)、進(jìn)入蘋果Apple Developer --- Member Center - Certificates, Identifiers & Profiles – Identifiers - App IDs –Edit 然后開啟打鉤 Associated Domains 后保存。
?2)、項(xiàng)目-target-Capabilities-Associated Domains-off按鈕打開,點(diǎn)擊'+'添加
輸入 ‘a(chǎn)pplinks:服務(wù)器域名’ , 例如:applinks:launcheapp.aheading.com
2、apple-app-site-association文件
apple-app-site-association是IOS中一個(gè)JSON格式的“通用鏈接”配置文件,在其paths鍵中設(shè)置通用鏈接的具體規(guī)則。
{
? ? ? ?"applinks": {
? ? ? ? ? ? ? ? ?"apps": [],
? ? ? ? ? ? ? ? ?"details": [
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"appID": "PWDGGXDDAS.com.ahead.app"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "paths": ["*"] ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ]
? ? ? ? ? ? ? ? ? ? ? ?}
? ?}
appID:TeamID.bundid
注: 我從開發(fā)者-Membership中找到teamId,發(fā)現(xiàn)跳轉(zhuǎn)不了。最后在Certificates, Identifiers & Profiles中appids下有Prefix,跳轉(zhuǎn)成功
path:內(nèi)容可明確哪些通用鏈接需要被處理,哪些不需要;'*'代表任何鏈接都可以跳轉(zhuǎn)(注意:區(qū)分大小寫)例如:[ "/wwdc/news/", "NOT /videos/wwdc/2010/*"]
創(chuàng)建名為apple-app-site-association文件,不需要任何后綴名,放入服務(wù)器根目錄下,并且服務(wù)器支持https的。
配置完以上步驟后,第一次安裝app的時(shí)候,app會(huì)從 “域名/apple-app-site-association” 這個(gè)鏈接中下載文檔(抓包)
安裝完后,可以把 “域名/apple-app-site-association”鏈接添加到備忘錄,長時(shí)間點(diǎn)擊,會(huì)出現(xiàn)一下界面,說明配置成功

最后可以在AppDelegate進(jìn)行數(shù)據(jù)操作
-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler;
注意事項(xiàng):
1、WAP頁面的域(a.com)和拋出的通用鏈接的域(b.com)必須不一樣。如果同域,拋出的通用鏈接在很多情況下會(huì)被系統(tǒng)忽略,就算已安裝APP,也打不開并且直接重定向到下載頁。
2、該方法適用于iOS9以上,所以要適配iOS9以下的,通用鏈接和URLScheme都要寫上
1、跳轉(zhuǎn)到別的app
iOS9后就要添加跳轉(zhuǎn)app的白名單,info.plist -LSApplicationQueriesSchemes
2、跳轉(zhuǎn)到自己的app
在info.plist中注冊(cè)URL Schemes?


注冊(cè)完成后,app安裝到手機(jī)上,在safari中輸入 aheading:// 就可打開app