Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] 微信登录,没有唤起微信,直接返回ERR_AUTH_DENIED #29

Closed
aqingsao opened this issue May 23, 2015 · 6 comments
Closed

Comments

@aqingsao
Copy link

@xu-li 您好,

我在使用微信登录时,严格按照说明步骤,签名、appId均设置正常。Wechat.isInstalled方法调用也正常,但是微信登录接口(Wechat.auth)无法唤起微信进行授权:

  var scope = "snsapi_userinfo";
  Wechat.auth(scope, function (response) {
    // 没有进入这里
  }, function (reason) {
    // 返回的reason是 'ERR_AUTH_DENIED'
  });

在测试过程中,只有一次显示了微信登录授权页面,其他都返回'ERR_AUTH_DENIED'错误。

不知道您有没有遇到类似的问题?多谢!

张晓庆

@xu-li
Copy link
Owner

xu-li commented May 25, 2015

@aqingsao 不好意思,暂时没时间测试这个BUG,可能周末会有空。

Android的版本的代码主要来自另外一个微信的插件, 你可以问问@vilic

个人推断,既然已经成功过一次,那是否可以reset emulator,然后重新安装一下?主要排除其它外界因素的干扰,iOS的版本以前碰到的情况就是两个不同的APP里面URL Type设置成一样了,导致微信回调失败。

当然你的微信平台上的设置需要确保正确。

希望有所帮助。

@aqingsao
Copy link
Author

谢谢@xu-li
我在android上测试的,换了个手机,微信登录时,发现唤起成功。由于还在开发过程中,没有做后续处理(比如保存access_token, refresh_token, openId等),再次点击微信登录(调用微信授权Wechat.auth)时,不会再次唤起微信。
我理解这应该是微信的功能,避免让用户重复授权,而应该程序把相关信息保存下来,后续直接使用。

感谢您及时的回复,我再学习一下。

@xu-li xu-li closed this as completed May 28, 2015
@kinhunt
Copy link

kinhunt commented Jun 19, 2015

我遇到了类似的问题,第一次能够唤起微信,之后就唤起不了

Permission Denial: receiving Intent { act=com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER flg=0x10 (has extras) } to com.infinit.wostore.ui/com.unicom.push.shell.PushReceiver requires com.tencent.mm.permission.MM_MESSAGE due to sender cn.test.test (uid 10257)
E/PersonaManagerService( 3105): inState():  stateMachine is null !!
W/ActivityManager( 3105): mDVFSHelper.acquire()
W/PluginManager( 1590): THREAD WARNING: exec() call to Wechat.sendAuthRequest blocked the main thread for 65ms. Plugin should use CordovaInterface.getThreadPool().
E/MtaSDK  ( 1590): Could not get permission of android.permission.READ_PHONE_STATE
W/MtaSDK  ( 1590): [pool-2-thread-1(2655): null:-1] - can not get the permission of android.permission.WRITE_EXTERNAL_STORAGE
W/ActivityManager( 3105): getTasks: caller 10178 does not hold GET_TASKS; limiting output
E/ActivityManager( 3105): Invalid thumbnail dimensions: 576x576
W/ActivityManager( 3105): Duplicate finish request for ActivityRecord{3b459d20 u0 com.tencent.mm/.plugin.base.stub.WXEntryActivity t148 f}
W/InputMethodManagerService( 3105): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@38bad0aa attribute=null, token = android.os.BinderProxy@1665eaab
W/ActivityManager( 3105): getTasks: caller 10178 does not hold GET_TASKS; limiting output
E/MtaSDK  ( 1590): [pool-5-thread-1(2659): null:-1] - Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}
E/MtaSDK  ( 1590): [pool-5-thread-1(2659): null:-1] - Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}

@kinhunt
Copy link

kinhunt commented Jun 19, 2015

ios 没问题,没想明白 server 404 invalid appkey 是怎么回事,config里 wechatappid 设置正确

@zhangjinhuang
Copy link

我今天也遇到了Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}这个问题,但是只是在第一次调起微信授权登录时才出现这个信息,微信授权登录界面也可以出来,但是点击登录界面却直接返回了,也没有任何提示,求解?

@zhanzengyu
Copy link

@kinhunt @zhangjinhuang 想问下你们解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants