美文网首页
微信SDK(Universal Link配置)升级,友盟分享SD

微信SDK(Universal Link配置)升级,友盟分享SD

作者: Liebling_zn | 来源:发表于2020-09-01 12:56 被阅读0次

    在做项目时发现微信的sdk从1.8.6版本开始,在registerApp的时候必须提供universalLink 微信开发者Universal Link,友盟分享的sdk在6.9.9版本也是需要提供配置universalLink,而且友盟也不在提供微信的精简版本。

    网上已经有很多,对于universalLink配置的教程,这里就不在做过多介绍;

    主要是介绍下重点要注意的地方:
    apple-app-site-association文件的写法:

    {
        "applinks": {
            "apps": [],
            "details": [
                {
                    "appID": "TEAM.com.test.company",
                    "paths": [ "/app/*"]
                }
            ]
        }
    }
    

    然后把这个apple-app-site-association文件,放在自己服务器的根目录下,如:https://www.xxxx.com
    在xcode - Associated Domains里面可以这样写:
    applinks:www.xxxx.com

    特别注意:在微信开放平台后台的配置是apple-app-site-association所在服务器的域名加上文件里面的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};
    

    基本这么配置后就能正常调用分享了

    相关文章

      网友评论

          本文标题:微信SDK(Universal Link配置)升级,友盟分享SD

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