- IOS端SDK登录调用报错?
2022-05-10 19:18:44.945440+0800 qn[8088:1124658] WeChatSDK: wxlog:send req[<SendAuthReq: 0x281678330>], appID:wxeb8dcb0164732106, universalLink:https://weixinul.new1000y.com/, sdkVersion:1.8.6.1 2022-05-10 19:18:44.969232+0800 qn[8088:1124658] WeChatSDK: wxlog:set property list 2022-05-10 19:18:44.972666+0800 qn[8088:1124658] WeChatSDK: wxlog:Error:fail to load Keychain status:-25300, keyData null:1 2022-05-10 19:18:44.972723+0800 qn[8088:1124658] WeChatSDK: wxlog:Error:token[(null)] is null 2022-05-10 19:18:45.061924+0800 qn[8088:1124658] WeChatSDK: wxlog:launch app with ul only success 2022-05-10 19:18:45.062020+0800 qn[8088:1124658] WeChatSDK: wxlog:launch app with universal link, ret:1 2022-05-10 19:18:45.062083+0800 qn[8088:1124658] WeChatSDK: wxlog:req:<SendAuthReq: 0x281678330>, cid:d7b7c9b553dfb06c33a0827d2953c5b03cb3a424 点击微信登录报这个错误 appid wxeb8dcb0164732106 浏览器中打开 wecaht:// 可成功调用微信 已经提交日志,微信号:BeatMicrosoft
2022-05-10 - 微信支付回掉resp为空
接入的是微信支付和登录,登录回掉没问题也拿到了,resp.errorCode,但是支付的回掉拿不到errorCode,支付回来resp报空指针。微信支付可以正常调起,并成功支付,我们的后端也通过,就在支付完,返回商家的时候报错。代码如下: [代码]-([代码][代码]void[代码][代码]) onResp:(BaseResp *)resp[代码][代码]{[代码][代码] [代码][代码]if[代码][代码]([resp isKindOfClass:[SendAuthResp [代码][代码]class[代码][代码]]])[代码][代码] [代码][代码]{[代码][代码] [代码][代码]SendAuthResp *temp = (SendAuthResp*)resp;[代码][代码] [代码][代码]int[代码] [代码]errorCode = temp.errCode;[代码][代码] [代码][代码]NSLog(@[代码][代码]"ddddd%@"[代码][代码],temp.code);[代码][代码] [代码][代码]NSLog(@[代码][代码]"ddddd%d"[代码][代码],errorCode);[代码][代码] [代码][代码]switch[代码] [代码](errorCode) {[代码][代码] [代码][代码]case[代码] [代码]0:[代码][代码] [代码][代码]{[代码][代码] [代码][代码]printf[代码][代码]([代码][代码]"登录成功-xcode"[代码][代码]);[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatGetAccessToken"[代码][代码], [temp.code UTF8String]);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]case[代码] [代码]-2:[代码][代码] [代码][代码]printf[代码][代码]([代码][代码]"用户取消"[代码][代码]);[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatGetAccessToken"[代码][代码], [代码][代码]"-2"[代码][代码]);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]case[代码] [代码]-4:[代码][代码] [代码][代码]printf[代码][代码]([代码][代码]"用户拒绝授权"[代码][代码]);[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatGetAccessToken"[代码][代码], [代码][代码]"-4"[代码][代码]);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]default[代码][代码]:[代码][代码] [代码][代码]printf[代码][代码]([代码][代码]"登录失败"[代码][代码]);[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatGetAccessToken"[代码][代码], [代码][代码]"-9"[代码][代码]);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]else[代码] [代码]if[代码][代码]([resp isKindOfClass:[PayResp [代码][代码]class[代码][代码]]])[代码][代码] [代码][代码]{[代码][代码] [代码][代码]PayResp *response = (PayResp*)resp;[代码][代码] [代码][代码]int[代码] [代码]errorCode = response.errCode; // 这里response为空,但登录的是没问题的[代码][代码] [代码][代码]NSLog(@[代码][代码]"ddddd%@"[代码][代码],errorCode);[代码][代码] [代码][代码]switch[代码] [代码](response.errCode) {[代码][代码] [代码][代码]case[代码] [代码]WXSuccess:[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatCallback"[代码][代码], 0);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]default[代码][代码]:[代码][代码] [代码][代码]UnitySendMessage([代码][代码]"SdkCenter"[代码][代码], [代码][代码]"WeChatCallback"[代码][代码], 1);[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]}[代码]奇怪的是,isKindOfClass的时候判断是PayResp类型,是进到else if里面之后才报的空指针
2019-08-28