在做項(xiàng)目時發(fā)現(xiàn)微信的sdk從1.8.6版本開始,在registerApp的時候必須提供universalLink 微信開發(fā)者Universal Link倡怎,友盟分享的sdk在6.9.9版本也是需要提供配置universalLink迅耘,而且友盟也不在提供微信的精簡版本。
網(wǎng)上已經(jīng)有很多监署,對于universalLink配置的教程颤专,這里就不在做過多介紹;
主要是介紹下重點(diǎn)要注意的地方:
apple-app-site-association文件的寫法:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAM.com.test.company",
"paths": [ "/app/*"]
}
]
}
}
然后把這個apple-app-site-association文件,放在自己服務(wù)器的根目錄下钠乏,如:https://www.xxxx.com
在xcode - Associated Domains里面可以這樣寫:
applinks:www.xxxx.com
特別注意:在微信開放平臺后臺的配置是apple-app-site-association所在服務(wù)器的域名加上文件里面的paths路徑:
Universal Links:https://www.xxxx.com/app/
AppDelegate.m中注冊微信API的時候:
#define WXUniversalLinks @"https://www.xxxx.com/app/" //必須要和微信開放平臺一致:
[WXApi registerApp:WXAppID universalLink:WXUniversalLinks];
友盟配置UL
[UMSocialGlobal shareInstance].universalLinkDic = @{@(UMSocialPlatformType_WechatSession):WXUniversalLinks};
基本這么配置后就能正常調(diào)用分享了