uniapp ios platform Universal Link settings

Universal Link settings for ios platform

Step 1: Start the Associated Domains service

Log in to the Apple developer website , select the corresponding App ID in "Identifiers" on the "Certificates, Identifiers & Profiles" page, and make sure the Associated Domains service is turned on.img

After enabling the Associated Domains service, you need to regenerate the profile file and use it when submitting to the cloud for packaging.

Step 2: Server configuration apple-app-site-association file (this file is in json format, but cannot have the .json suffix)

{
    
      
    "applinks": {
    
      
        "apps": [],  
        "details": [  
            {
    
      
                "appID": "uni.UNIxxxxxx", //包名 
                "paths": ["*"]   
            }  
        ]  
    }  
}
//apps
//--必须对应一个空的数组
//appID
//--由前缀和ID两部分组成,可以登录苹果开发者网站,在“Certificates, Identifiers & Profiles”页面选择“Identifiers”中选择对应的App ID查看
//此处用的是uniapp云打包的包名,因为苹果开发者网站设置的id也是这个!
//paths
//--对应域名中的path,用于过滤可以跳转到App的链接,支持通配符*,?以及NOT进行匹配,匹配的优先级是从左至右依次降低

Notice:

1. Do not directly copy and use the above example. You must modify it according to the configuration of your own application.

2.Must be https

3. Upload the configured apple-app-site-association file to your own server and make sure it is accessible through https://demo.dcloud.net.cn/.well-known/apple-app-site-association.

Among them, demo.dcloud.net.cn is the domain name configured above.
After the application is installed, it will register the universal link of the application with the system by accessing the above URL.

Step 3: On the WeChat open platform, configure a universal link for the bound APPID

在绑定的APP下配置JSON文件所在的域名为通用链接:https://www.xxx.com/.well-known/

Pay attention to configure universal link with WeChat backend, don’t forget to add “/” at the end

**Step 4: In HbuildX, open the manifest.json file of the project and configure "iOS platform universal links (Universal Links)" **

1. In the "plus" -> "distribute" -> "apple" -> "capabilities" -> "entitlements" node (uni-app project is in "app-plus" -> "distribute" -> "ios" -> Add the "com.apple.developer.associated-domains" field under "capabilities" -> "entitlements"). The field value is an array of strings, and each string is the domain name to be associated.

 "ios" : {
    "capabilities" : {
        "entitlements" : {
            "com.apple.developer.associated-domains" : [ "applinks:www.xxx.vip" ]
        }
    }
},

**Note: **www.tianse.vip is the domain name of the server, no http protocol header is required

2. Configure Universal Links information in WeChat Pay & WeChat Sharing & WeChat Login

"UniversalLinks": "https://www.xxx.vip/.well-known/" The path is consistent with the WeChat open platform
   /* SDK配置 */
"sdkConfigs" : {
    "ad" : {},
    "payment" : {
        "alipay" : {
            "__platform__" : [ "ios", "android" ]
        },
        "weixin" : {
            "__platform__" : [ "ios", "android" ],
            "appid" : "",
            "UniversalLinks" : "https://www.xxx.vip/.well-known/"
        },
        "appleiap" : {}
    },
    "share" : {
        "weixin" : {
            "appid" : "",
            "UniversalLinks" : "https://www.xxx.vip/.well-known/"
        }
    },
    "oauth" : {
        "weixin" : {
            "appid" : "",
            "appsecret" : "",
            "UniversalLinks" : "https://www.xxx.vip/.well-known/"
        }
    },

},

Reference website:

https://ask.dcloud.net.cn/article/36393#unilink

https://ask.dcloud.net.cn/article/36445

https://blog.csdn.net/rxq134836/article/details/114918110

et.cn/article/36393#unilink

https://ask.dcloud.net.cn/article/36445

https://blog.csdn.net/rxq134836/article/details/114918110

https://uniapp.dcloud.io/api/plugins/universal-links

Guess you like

Origin blog.csdn.net/m0_52459016/article/details/122089090