Wechat unverified application (integration of wechat openSDK1.8.6)

Keywords: iOS SDK xcode

;

Maybe recently some friends found that some content shared by App is displayed in wechat as unverified App, but not every version of wechat

iOS access guide

In wechat 7.0.7(iOS 12-13) and above, there may be "unverified applications" (currently, it seems that IOS 12-13 has this feature)

This is mainly due to security considerations. Wechat transforms scheme hops into universal links (I found that this is not a full amount in my test, as is the case on IOS 12-13)

Points of attention

info.plist Add LSApplicationQueriesSchemes(Array) and two elements weixin weixinULAPI

Response method of old scheme (or degradation)

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

The new method

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler;

Possible pit during integration

How to fill in the universal link

There are two parts here. The first part is within the project. For example, in the Associated Domains of SDKSample help.wechat.com .

applinks:help.wechat.com

Apple App site association file of wechat SDKDemo

This file needs to be placed in the root path of the URL you fill in, for example, this demo needs to be placed in the

https://help.wechat.com/apple-app-site-association

Next or

https://help.wechat.com/.well-known/apple-app-site-association

Also note that this file cannot have a suffix

The request time of this file is when the App is installed, the system automatically requests the content filled in the Associated Domains. Therefore, when testing, you can delete and install the App again

///There are many in details, but I focus on SDK sample
{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "8P7343TG54.com.tencent.wc.xin.SDKSample",
                "paths": [
                    "/sdksample/*"
                ]
            }
        ]
    }
}

Registration code within the project

//Register with wechat
[WXApi registerApp:@"wxd930ea5d5a258f4f" universalLink:@"https://help.wechat.com/sdksample/"];

So what do you want to fill in here

After my test, in Xcode [wxapi registerapp: @ "wxd930ea5d5a258f4f" universalink:@“ https://help.wechat.com/sdksample/ This URL of "]; needs to be the same as the universalink filled in by wechat open platform (wechat requires HTTPS at the beginning and / at the end)

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
	if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
		NSURL *webpageURL = userActivity.webpageURL;
        NSString *absoluteString = webpageURL.absoluteString;
        if ([absoluteString containsString:@"wxd930ea5d5a258f4f"]) {///You can judge in this way, or make a path for wechat
        	[WXAPI handleUniversal
        }
	}
}

Multiple secondary jumps during sharing

Multiple confirmation pop ups at login

If there is no above situation, but the application is still displayed after sharing, it may not be refreshed. It may take a day Click here for details.

About being rejected

Wechat OpenSDk update instructions

We can find out

SDK1.8.6.2

Modify the class name that contains the "UIWebView" character


SDK1.8.6.1

Switch UIWebview to WKWebview
 Support Universal Link to pull up wechat and return to App
 Remove MTA Library

In 2020, Apple will not allow the new package to include UIWebView function, and in December 2020, the old package will not be allowed to submit and update UIWebView, so it is recommended that you use version 1.8.6.2 and above (this is not allowed to include the UIWebView character This has been verified in a new project of my friend's company 23333)

About lower left picture

This picture is the picture of the App on the wechat open platform (it didn't seem like this before), this needs attention (PS: spit out a slot, I have seen that the pictures of several apps are misplaced )

Posted by TouranMan on Fri, 05 Jun 2020 21:27:43 -0700