- WechatOpenSDK (1.8.7.1) 报错:-25300 怎么处理?
复现步骤: 一 cocoapods 安装 open sdk,版本 1.8.7.1: pod 'WechatOpenSDK' 二 在 Info.plist 配置 Schema 以及 URL Types 中配置 微信 appId: [图片] 三 AppDelegate 注册 WXApi 及实现 WXApiDelegate: @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // WechatOpenSDK WXApi.startLog(by: .detail) { (msg) in print("WXApi log: \(msg)") } // 已使用 safari 验证 "https://sub.domain.com/link" 可以正常调起 app WXApi.registerApp(Configs.WeChat.appID, universalLink: "https://sub.domain.com/link") print("WXApi version: \(WXApi.getVersion())") return true } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { return WXApi.handleOpen(url, delegate: self) } func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { return WXApi.handleOpenUniversalLink(userActivity, delegate: self) } } extension AppDelegate: WXApiDelegate { // wechat delegate func onReq(_ req: BaseReq) { print("wechat onReq \(req.debugDescription)") } func onResp(_ resp: BaseResp) { print("wechat onResp \(resp.debugDescription)") } } 四 在 ViewController 调用 WXApi 的 方法: + (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion; 五 结果如下: 回调值 userActivity.webpageURL: "https://sub.domain.com/link/wxxxxxxx/refreshToken?wechat_auth_token=xxxx&wechat_auth_context_id=TestAutoCheckContextId_xxxxxx" Log 记录: " WXApi log: wxlog:set property list WXApi log: wxlog:send req[], appID:wxxxxxxxx, universalLink:https://sub.domain.com/link/, sdkVersion:1.8.7.1 WXApi log: wxlog:set property list WXApi log: wxlog:Error:fail to load Keychain status:-25300, keyData null:1 WXApi log: wxlog:token[(null)] is null WXApi log: wxlog:launch app with ul only success WXApi log: wxlog:Successfully starting WeChat with the universal link. WXApi log: wxlog:launch app with ul only success WXApi log: wxlog:launch app with universal link, ret:1 WXApi log: wxlog:req:, cid:xxxxxxxxxx WXApi.send isOk: true WXApi log: wxlog:WXCheckULStepResult[success: 1, errorInfo: Universal Link check passed. The application is launched by WeChat via Universal Link, suggestion: ] WXApi log: wxlog:WXCheckULStepResult[success: 1, errorInfo: All Check Passed!, suggestion: ] " 调用 + (void)checkUniversalLinkReady:(nonnull WXCheckULCompletion)completion; checkUniversalLinkReady: step 0, success true, errorInfo check passed, suggestion checkUniversalLinkReady: step 1, success true, errorInfo check passed, suggestion checkUniversalLinkReady: step 2, success true, errorInfo check passed, suggestion WXApi log: wxlog:set property list checkUniversalLinkReady: step 3, success true, errorInfo check passed, suggestion WXApi log: wxlog:send req[], appID:wx04155bc44c349cd2, universalLink:https://guardian.kid17.com/link/, sdkVersion:1.8.7.1 WXApi log: wxlog:set property list WXApi log: wxlog:Error:fail to load Keychain status:-25300, keyData null:1 WXApi log: wxlog:token[(null)] is null WXApi log: wxlog:launch app with ul only success checkUniversalLinkReady: step 4, success true, errorInfo check passed, suggestion WXApi log: wxlog:Successfully starting WeChat with the universal link. WXApi log: wxlog:launch app with ul only success WXApi log: wxlog:launch app with universal link, ret:1 WXApi log: wxlog:req:, cid:xxxxxxxxxxxxxxxxxxxxx WXApi.send isOk: true 该如何解决呢? 微信号:kid17-test 微信日志已上传,时间 2020-06-11 19:44
2020-06-11 - 关于android机WebSocket 断线重连影响性能问题
设备:红米4A 系统版本:Android 6.0.1 代码如下: [代码] wx.connectSocket({[代码][代码] [代码][代码]url: [代码][代码]address[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketOpen([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'WebSocket连接已打开!'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketError([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.error([代码][代码]'WebSocket连接打开失败,请检查!'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketMessage([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'收到服务器内容:'[代码] [代码]+ res.data)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketClose([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.error([代码][代码]'WebSocket 已关闭!'[代码][代码])[代码]setTimeout(function () { console.log('正在重新链接...') wx.connectSocket({ url: address }) }, 1.5 * 1000); [代码][代码][代码][代码][代码] [代码][代码]})[代码] 当手机网络完全断开后,WebSocket 会不断重连,导致手机CPU, 内存使用率爆表,直到程序崩溃。
2017-08-03 - 怎么查询redis?
RT, 客户端需要查询redis,但是 require('redis')并没有用。
2017-02-10