FDK 0-1-check passed- FDK 1-1-check passed- FDK 2-1-check passed- FDK wxlog:set property list FDK 3-1-check passed- FDK wxlog:launch app with ul only success FDK 4-1-check passed- FDK wxlog:Successfully starting WeChat with the universal link. FDK 5-1-Universal Link check passed. The application is launched by WeChat via Universal Link- FDK wxlog:WXCheckULStepResult[success: 1, errorInfo: Universal Link check passed. The application is launched by WeChat via Universal Link, suggestion: ] FDK 6-1-All Check Passed!- FDK wxlog:WXCheckULStepResult[success: 1, errorInfo: All Check Passed!, suggestion: ] FDK wxlog:send req[<SendAuthReq: 0x280a2d740>], appID:wx659b8f62aa3d7eee, universalLink:https://4sight.club/app/flippin/, sdkVersion:1.8.7.1 FDK wxlog:set property list FDK wxlog:launch app with ul only success FDK wxlog:launch app with universal link, ret:1 FDK wxlog:req:<SendAuthReq: 0x280a2d740>, cid:33d9386c4a1e986db3913e6a027890c7b8ccd60d FDK wxlog:Error:set token fail, errCode:4, errLog:wx token[] or contextId[(null)] is nil!
然后跳转到微信回来后直接报错这个 Error:set token fail, errCode:4, errLog:wx token[] or contextId[(null)] is nil!
时隔几年,重新接ios微信登陆,也遇到了问题,在社区论坛搜了类似问题都没有收获,就在绝望之际 看到了这个
官方升级的 ReadMe文件
SDK1.9.9
1. 授权登录支持关闭自动授权
2. 分享支持添加签名,防止篡改
因 查看日志发现,其实返回了 code 但是 微信唤起的时候 一闪而过,有返回code 但是和前些年接入的时候交互不同,于是就在代码搜索 自动 搜到了这个:
/** 是否关闭自动授权 * @note YES为关闭自动授权,每次登陆都需要用户手动授权;NO为允许自动授权 */ @property (nonatomic, assign) BOOL nonautomatic;
于是思考 是否是因为 默认启动了 自动授权呢?于是登陆逻辑修改为
//构造SendAuthReq结构体 SendAuthReq* req =[[SendAuthReq alloc ] init ]; req.scope = @"snsapi_userinfo";// 只能填 snsapi_userinfo req.state = @"snake"; //此处需要填写自己的key req.nonautomatic = YES;//nonautomatic 属性来控制授权行为 可以这样设置为关闭自动授权 //第三方向微信终端发送一个SendAuthReq消息结构 [WXApi sendReq:req completion:nil];
然后就看到了 选择 取消、拒绝,登陆按钮的页面了!!!
很奇怪,微信这么大的改动,接入文档里居然没有提及,让我耗费了几个小时一直以为是自己哪里接入错误了
然后就上面的错误,始终没有发现是哪里的错误
这个问题是否可以忽略掉?貌似不影响使用code?
自检通过了 跳转到微信页面也没有二次弹窗 新版本到SDK 放回APP没有执行微信代理 2021-02-20 10:17:02.349965+0800 HereIAm[394:12410] PBItemCollectionServicer connection disconnected.
wxlog:Error:set token fail, errCode:4, errLog:wx token[] or contextId[(null)] is nil!
这个是我用wxApi自检 的日志
FDK 0-1-check passed-
FDK 1-1-check passed-
FDK 2-1-check passed-
FDK wxlog:set property list
FDK 3-1-check passed-
FDK wxlog:launch app with ul only success
FDK 4-1-check passed-
FDK wxlog:Successfully starting WeChat with the universal link.
FDK 5-1-Universal Link check passed. The application is launched by WeChat via Universal Link-
FDK wxlog:WXCheckULStepResult[success: 1, errorInfo: Universal Link check passed. The application is launched by WeChat via Universal Link, suggestion: ]
FDK 6-1-All Check Passed!-
FDK wxlog:WXCheckULStepResult[success: 1, errorInfo: All Check Passed!, suggestion: ]
FDK wxlog:send req[<SendAuthReq: 0x280a2d740>], appID:wx659b8f62aa3d7eee, universalLink:https://4sight.club/app/flippin/, sdkVersion:1.8.7.1
FDK wxlog:set property list
FDK wxlog:launch app with ul only success
FDK wxlog:launch app with universal link, ret:1
FDK wxlog:req:<SendAuthReq: 0x280a2d740>, cid:33d9386c4a1e986db3913e6a027890c7b8ccd60d
FDK wxlog:Error:set token fail, errCode:4, errLog:wx token[] or contextId[(null)] is nil!
然后跳转到微信回来后直接报错这个
Error:set token fail, errCode:4, errLog:wx token[] or contextId[(null)] is nil!
提供下appid :wx659b8f62aa3d7eee,
(在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点)
微信号:fushaoying2016
时间点:2023年3月9. 15:48
iOS微信SDK更新到1.8.7后 本来旧版本是正常的授权登录,现在新版本 调到微信后 未出现授权界面 而是直接返回了APP 绑定失败 检测函数 全通过 分享支付没问题 求官方帮助处理下 还是本来这是微信的Bug ? @微信官方
你好,使用检测函数验证Universal Link是否生效https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html#jump4,也参考下https://developers.weixin.qq.com/community/develop/doc/0000a66f9f8cb898f59954d585bc09