xu-li / cordova-plugin-wechat

A cordova plugin, a JS version of Wechat SDK
1.22k stars 509 forks source link

微信认证sendAuthRequest调用成功但是没有微信没有打开 #280

Closed woshibt closed 5 years ago

woshibt commented 8 years ago
            //微信登录
            Wechat.isInstalled(function (installed) {
                WEIXININSTALL = installed;
                alert("installed:" + installed)

                if (!WEIXININSTALL) {
                    $ionicLoading.show({ template: "没有检测到微信。请先在手机上安装微信!", noBackdrop: true, duration: 2000 });
                } else {
                    var scope = "snsapi_userinfo";
                    var state = "wechat";
                    Wechat.auth(scope, state, function (response) {
                        // you may use response.code to get the access token.
                        alert(JSON.stringify(response));
                    }, function (reason) {
                        alert("Failed: " + reason);
                    });
                }
            }, function (error) {
                alert(error)
            });

11-09 19:16:29.359 6922 6955 D Cordova.Plugin.Wechat: AppId: wx954dd11f161d7131. 11-09 19:16:29.395 6922 6955 D Cordova.Plugin.Wechat: plugin initialized. 11-09 19:16:29.395 6922 6955 D Cordova.Plugin.Wechat: isWXAppInstalled is called. Callback ID: Wechat226973373. 11-09 19:16:29.530 6922 7011 I MID : read mid from InternalStorage 11-09 19:16:29.538 6922 7011 I MID : read mid from InternalStorage:xjgD6zAYj0Q32BWC1ZxE5XOQIZh84Hm8SnAJpFaX2PhicUBmi+vXgrY0Hzb7T3EJQUN0x+dWSUw7FCAZrFLQN1QAmKc8tpaWULSkS32g5uwnpqBPIdtnCUZh8XROS00rIAZox+SCzb5dMFk/xkqEZGqiOk7u 11-09 19:16:29.626 6922 7019 D NetworkSecurityConfig: No Network Security Config specified, using platform default 11-09 19:16:29.685 4326 4326 I cm.log.servpro: [forcestop_listener][D]/ onAccessibilityEvent android.app.AlertDialog, mListened = false 11-09 19:16:30.460 6922 6955 D Cordova.Plugin.Wechat: sendAuthRequest is called. Callback ID: Wechat226973374. 11-09 19:16:30.464 864 4227 I ActivityManager: START u0 {flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXEntryActivity (has extras)} from uid 10171 on display 0 11-09 19:16:30.482 864 3246 W InputMethodManagerService: Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@c0e1f4c (uid=10171 pid=6922) 11-09 19:16:30.484 6922 6922 V MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb: com.med163.yixuekaoyan.MainActivity onActivityPaused 11-09 19:16:30.495 6922 6955 I Cordova.Plugin.Wechat: Auth request has been sent successfully. 11-09 19:16:30.495 6922 6955 W PluginManager: THREAD WARNING: exec() call to Wechat.sendAuthRequest blocked the main thread for 36ms. Plugin should use CordovaInterface.getThreadPool(). 11-09 19:16:30.517 864 18640 W InputMethodManagerService: Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@c0e1f4c (uid=10171 pid=6922) 11-09 19:16:30.527 864 4252 W InputMethodManagerService: Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@c0e1f4c (uid=10171 pid=6922) 11-09 19:16:30.677 864 884 I WindowManager: Destroying surface Surface(name=com.med163.yixuekaoyan/com.med163.yixuekaoyan.MainActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.destroyOrSaveSurface:2073 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:491 com.android.server.wm.WindowAnimator.updateWindowsLocked:303 com.android.server.wm.WindowAnimator.animateLocked:704 11-09 19:16:30.917 864 17244 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@54ab95 attribute=android.view.inputmethod.EditorInfo@a92a4aa, token = android.os.BinderProxy@c25aeb5 11-09 19:16:30.918 864 17243 W ActivityManager: Finishing task with all activities already finished 11-09 19:16:30.918 864 17243 W ActivityManager: Duplicate finish request for ActivityRecord{1d91120 u0 com.tencent.mm/.plugin.base.stub.WXEntryActivity t177 f} 11-09 19:16:30.918 6922 6960 W IInputConnectionWrapper: finishComposingText on inactive InputConnection 11-09 19:16:30.935 6922 6922 V MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb: com.med163.yixuekaoyan.MainActivity onActivityResumed 11-09 19:16:31.152 4326 4326 I cm.log.servpro: [forcestop_listener][D]/ onAccessibilityEvent com.med163.yixuekaoyan.MainActivity, mListened = false 11-09 19:16:31.736 6922 6922 V MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb: WXStat trigger onForeground 11-09 19:16:31.960 32393 32429 I Finsky : [4190] com.google.android.finsky.c.e.run(2152): Replicating app states via AMAS. 11-09 19:16:32.104 32393 32429 I Finsky : [4190] com.google.android.finsky.c.c.a(314): Completed 0 account content syncs with 0 successful. 11-09 19:16:32.105 32393 32393 I Finsky : [1] com.google.android.finsky.services.j.a(148): Installation state replication succeeded.

xu-li commented 7 years ago

可能签名不对。

wilhantian commented 7 years ago

即使所填写的APPID和签名正确,微信缓存机制也会导致不能调起,这时候重启下手机(没开玩笑)就好了

xiaohui-zhangxh commented 7 years ago

@wilhantian 我郁闷了一个小时之后,看到你这个“玩笑”,就重启了下手机,还真不是个玩笑,微信界面调出来了 🤣

wilhantian commented 7 years ago

@xiaohui-zhangxh 23333