Q:Universal Link校验不通过,无法调起微信支付?
A:请开发者在调用register接口前,打开WXApi.h的日志接口,观察报错日志和原因:
+ (voidstartLogByLevel:(WXLogLevel)levellogBlock:(WXLogBolock)logBlock
Q:接入新SDK,跳到微信后再回跳App,流程就中止?
A:1. 首先,微信唤起App,App一定会收到系统回调。请确认系统回调是Scheme回调还是Universal Links回调。
2. 如果是Scheme回调,请检查是否走了UISceneDelegate(XCode11构建的项目),或是UIApplicationDelegate。它们的回调方法分别是
- (void)scene:(UIScene *)scene openURLContexts:(NSSetUIOpenURLContext *> *)URLContexts;
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionaryUIApplicationOpenURLOptionsKey, id> *)options;
3. 如果是Universal Links回调,同样也检查是否走了UISceneDelegate(XCode11构建的项目),或是UIApplicationDelegate。它们的回调方法分别是
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArrayidUIUserActivityRest
oring>> * __nullable restorableObjects))restorationHandler
4. 因为考虑兼容旧版本微信,因此无论Scheme或Universal Links回调都必须处理。 在重写回调方法后,需要分别调用WXApi的handleOpenUrl和handleOpenUniversalLink方法
示例:
- (voidscene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
return [WXApi handleOpenUniversalLink:userActivity delegate:self
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:void(^)(NSArrayidUIUserActivityRest
oring>> * __nullable restorableObjects))restorationHandler {
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html
checkUniversal Link 走到第提示 All Check passed, 两个系统都是13.5.1 的手机,一部分享流程正常,另一部手机可以分享但是最后会显示“未验证应用”,请问如何解决?
https://docs.qq.com/doc/DZHNvSGJLS3pqbHNl
大佬,我就问一句。不支持Universal Link 能用微信分享么?
2024了,还没人管管这个问题吗。真的头都要秃了,QQ怎么就能分享出去呢???
最终怎么解决的, 有解决方案吗
麻烦帮忙看看,配置啥的都检查了,appid:wx1f84e6e507ea082d,对应paths为xdxyh,微信号:yin921221
/**** 日志 ****/
2023-12-27 11:03:04.867888+0800 沪湘通达[292:6602] [Line 372] -[AppDelegate configLibs]_block_invoke WeChatSDK: wxlog:using sdk:pod--
2023-12-27 11:03:04.868386+0800 沪湘通达[292:6602] WeChatSDK queriesSchemes = (
weixinURLParamsAPI,
cmbmobilebank,
jiandui,
wechat,
weixin,
weixinULAPI
)
2023-12-27 11:03:04.868976+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 0, 1, check passed,
2023-12-27 11:03:04.869789+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 1, 1, check passed,
2023-12-27 11:03:04.875943+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 2, 1, check passed,
2023-12-27 11:03:05.178958+0800 沪湘通达[292:6602] [Line 372] -[AppDelegate configLibs]_block_invoke WeChatSDK: wxlog:set property list
2023-12-27 11:03:05.193421+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 3, 1, check passed,
2023-12-27 11:03:05.741928+0800 沪湘通达[292:6602] [Line 372] -[AppDelegate configLibs]_block_invoke WeChatSDK: wxlog:launch app with ul only success
2023-12-27 11:03:05.742358+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 4, 1, check passed,
2023-12-27 11:03:05.742405+0800 沪湘通达[292:6602] [Line 372] -[AppDelegate configLibs]_block_invoke WeChatSDK: wxlog:Successfully starting WeChat with the universal link.
2023-12-27 11:03:07.982417+0800 沪湘通达[292:6602] WeChatSDK checkUniversalLinkReady 5, 0, Universal Link check failed. The application is launched by WeChat via scheme, Common problems self-check guide: [微信开放平台App iOS端接入新版本SDK 常见问题自查指引]https://developers.weixin.qq.com/community/develop/doc/000ce0403bc9d0ea1a0a67f415b409
2023-12-27 11:03:07.982509+0800 沪湘通达[292:6602] [Line 372] -[AppDelegate configLibs]_block_invoke WeChatSDK: wxlog:Error:WXCheckULStepResult[success: 0, errorInfo: Universal Link check failed. The application is launched by WeChat via scheme, suggestion: Common problems self-check guide: [微信开放平台App iOS端接入新版本SDK 常见问题自查指引]https://developers.weixin.qq.com/community/develop/doc/000ce0403bc9d0ea1a0a67f415b409]
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi sendReq:isAutoResend:forceScheme:completion:]WXLog:send req[<WXLaunchMiniProgramReq: 0x28192ddc0>], appID:wxc1234d0ac0792a04, universalLink:https://abc.abc.com/, sdkVersion:2.0.2
[AppDelegate.m:152行] WXApi:WeChatSDK: [AppCommunicateData.m]-[AppCommunicateData ReqToData:withMediaInternalMessage:]WXLog:LaunchMiniProgram todata extDic=(null)
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi sendReq:isAutoResend:forceScheme:completion:]WXLog:send req transformToUrl data len:276, erased:0
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi sendReq:isAutoResend:forceScheme:completion:]WXLog:gen url with full params ok
[AppDelegate.m:152行] WXApi:WeChatSDK: [WeChatIdentityHandler.mm]+[WeChatIdentityHandler genWeChatUniversalLinkWithExtraUrl:token:contextId:paramsDataStr:unnecessaryDataErased:]WXLog:Error:urlStr is nil
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi launchApplicationWithUrl:completion:]WXLog:Error:launch app fail, url is nil!
[AppDelegate.m:152行] WXApi:WeChatSDK: [WeChatIdentityHandler.mm]+[WeChatIdentityHandler genWeChatUrlSchemeUrl:appendBundleID:isDegrade:paramsDataStr:unnecessaryDataErased:]WXLog:Error:urlStr:weixin://app/wxc1234d0ac0792a04/jumpWxa/?userName=2323&path=%3Fprice%3D10%26payOpenid%3s-eeee-8B4A-CADB-5DD0CD38&miniProgramType=2&extMsg=wechat_app_bundleId=com.rinlink.iot.xyshwechat_degrade_launch_by_scheme=1_wechat_sdk_support_url_params=1_wechat_sdk_biz_data_len=276_wechat_sdk_biz_data=Yeer44MDDWAQIDBAUGBwgJCgsMVnJlc3VsdFZzZGt2ZXJcaXNBdXRvUmVzZW5kXXVuaXZlcnNhbExpbmtXY29tbWFuZF1yZXR1cm5Gcm9tQXBwUTFVMi4wLjIIXxA5aHR0cHM6Ly9iMjYwNDdlNGY3Njg4MmNiYTM1ODAzOGEzNjEyZWEeeeFyZTJkbGluay5jb20vVDEwODBRMAgVHCMwPkZUVlxdmZ4AAAAAAAABAQAAAAAAAAANAAAAAAAAAAAAAAAAAAAAoA%3D%3D
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi launchWechatWithExtralUrl:forceScheme:contextId:paramsDataStr:unnecessaryDataErased:completion:]_block_invokeWXLog:Error:lauch app fail and need degrade, url:(null), schemeURL:(null)
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi launchApplicationWithUrl:completion:]WXLog:Error:launch app fail, url is nil!
[AppDelegate.m:152行] WXApi:WeChatSDK: [WXApi.m]+[WXApi launchWechatWithExtralUrl:forceScheme:contextId:paramsDataStr:unnecessaryDataErased:completion:]_block_invoke_2WXLog:degrade launch app ret:0, with url:(null)
[AppDelegate.m:160行] WXApi 调用自检函数:0, 1, check passed,
[AppDelegate.m:160行] WXApi 调用自检函数:1, 1, check passed,
[AppDelegate.m:160行] WXApi 调用自检函数:2, 1, check passed,
[AppDelegate.m:160行] WXApi 调用自检函数:3, 1, check passed,
[AppDelegate.m:160行] WXApi 调用自检函数:4, 1, check passed,
[AppDelegate.m:160行] WXApi 调用自检函数:5, 1, Universal Link check passed.
[AppDelegate.m:160行] WXApi 调用自检函数:6, 1, All Check Passed!,
[AppDelegate.m:152行] WXApi:WeChatSDK: wxlog:WXCheckULStepResult[success: 1, errorInfo: All Check Passed!, suggestion: ]
自检函数是通过,拉起微信支付也没问题,就是打开小程序报错
launchMiniProgramReq.userName = userName; //拉起的小程序的username
launchMiniProgramReq.path = path; ////拉起小程序页面的可带参路径,不填默认拉起小程序首页,对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。
launchMiniProgramReq.miniProgramType = miniProgramType; //拉起小程序的类型
return [WXApi sendReq:launchMiniProgramReq];
universallink配置成功,Associated Domains 也配了applinks:域名,甚至连https://域名 以及 https://域名/app都配了,Apple Developer检查也有勾选,URL Types、白名单也配了。
支付也成功了,跳回APP之后的流程:
在UIWindowSceneDelegate中:
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) // 一直不触发这个方法
func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String) // 每次都只是触发这个方法
怎么破?
app拉起微信小程序,跳转到微信这一步直接提示校验不通过,怎么解决呀