IOS wechat 1.8.7 docking and universal links detailed description (wechat application solution not verified)


Recently, wechat has begun to restrict some functions of the old version of the SDK. The sharing, third-party login, payment and other functions will appear unverified applications, so we have to update the latest version of the SDK. The following is mainly about the hole of docking with the latest version, mainly universal links (mainly do not understand).

1:Universal Links

To connect to the latest wechat SDK, you must know what universal links are, because the latest SDK judges whether the source app is credible according to universal links.

There are two mainstream IOS jump schemes


    2:Universal Links

The protocol of scheme is completely customized by developers, and there is no content to display when access fails. Therefore, universal links is introduced into ios9. Universal links uses the app app site association under the domain name to determine the app, because the domain name must be HTTPS and can not be repeated. It can also be used as an address to access the web page, which solves the above two problems.

2: Configure universal links

  • Configure Apple App site Association

First of all, you need to create an Apple App site association file (note that there is no suffix, plain text file) and put it in your HTTPS domain name directory to access the corresponding domain name You can download the files (or put them in the. Well known folder in the root directory, the same folder as the SSL certificate configuration folder, other folders have not been tried for the time being, and the partners who know can leave a message). The file content is a JSON string:

 1 {
 2     "applinks": {
 3         "apps": [],
 4         "details": [
 5             {
 6                 "appID": "%1.%2",
 7                 "paths": ["*" ]
 8             }
 9         ]
10     }
11 }

Where% 1 is the team ID of the apple developer account and% 2 is the bundle ID of the corresponding app

If you don’t know where you are, please refer to the following figure




What does path do in JSON

1: To tell Safari that those are universal links. For example: It is your domain name, and the path is configured as [“/ test / *”], then you can open it in safari There will be an app opening prompt, as shown in the following figure (this prompt diagram will only be available after the configuration in the next step)




You visit There was no hint

2: When starting the app, it will be sent to the app as a parameter. However, since this is for docking with wechat SDK, this content will not be studied in depth. Interested partners can study it

  • Configure associated domains

Check the associated domains of the corresponding app in the apple developer account


Configure it in Xcode (if you want to get the signature automatically, add the associated domains in Xcode, and the developer will automatically check the associated domains in the background)


Note that domains is the domain name in the previous step of Apple App site Association (do not add the path path, do not use the HTTPS: / /)

Here, the configuration of universal links is OK. Safari opens the corresponding link address when the app is re installed on the mobile phone (note that the opening prompt of my mobile phone needs to be pulled up to see it. As a result, I spent most of my time to confirm whether there is a configuration error, and later it is found on the above page)

3. Configure wechat SDK

  • Configuring universal links on wechat open platform




Among them, the links address should be accompanied by HTTPS: / / (see the wechat prompt text)

  • Configure URL type



Fill in the appid corresponding to the wechat open platform

  • Configure info



4. Wechat code editing

Initialization code editing:

[wxapi registerapp: @ "wechat appid" universalink:@“ ]

Back to code editing:

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray> * __nullable restorableObjects))restorationHandler
    return [WXApi handleOpenUniversalLink:userActivity delegate:self];

Note that only by adding wxapidelegate can the onresp be returned and the business code can remain unchanged


To test whether everything is normal, you can call wechat SDK self checking code

[WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
     NSLog(@"WeChatSDK: %@", log);
[wxapi registerapp: @ "wechat appid" universalink:@“ ]
[WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) { NSLog(@"step:%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion); }];


As shown in the figure below: This indicates successful docking



5: Precautions

After docking with the latest SDK, it may not be possible to remove the unverified application prompt immediately.According to wechat, it is explained as follows:The old version did not connect to the new version of opensdk correctly (there are two jumps to share and the second confirmation of authorization login). The new version has just fixed this problem. It is necessary to wait for the new version to scale up and reduce the overall error rate to below 90% before it is removed from the unproven application.

Reference documents:Troubleshooting of application not verified in IOS application

       Wechat IOS access guide

       Wechat IOS SDK Download