我正在使用gplus登录,并且在进入onActivityResult时收到此错误....
I am usign gplus sign in, and getting this error at time I am in onActivityResult....
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); callbackManager.onActivityResult(requestCode, resultCode, data); client.onActivityResult(requestCode, resultCode, data); if (requestCode == 0) { GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); if (result.isSuccess()) { GoogleSignInAccount acct = result.getSignInAccount(); // Log.d("Result","details"+ acct.getDisplayName() + acct.getEmail()); mEmail = acct.getEmail(); String mFullName = acct.getDisplayName(); String mGoogleplusId = acct.getId(); SocialUser user = new SocialUser(); user.setType("googleplus"); user.setEmail(mEmail); user.setFullname(mFullName); user.setId(mGoogleplusId + ""); loginParams.put("email_id", mEmail); loginParams.put("googlePlusId", mGoogleplusId); loginParams.put("full_name", mFullName); loginParams.put("registrationType", "googleplus"); SignUpService(user); } else { Toast.makeText(CustomerLogIn.this, "Unable to fetch data, Proceed manually", Toast.LENGTH_SHORT).show(); } } }我要求在单击按钮时登录gplus.在按动按钮时,将执行以下代码....
And I am calling for gplus login on button click. On clcking button following code is executed....
GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); mGoogleApiClient = new GoogleApiClient.Builder(CustomerLogIn.this) .addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions) .build(); Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, 0);我正在解决这个错误...
And I am geetng this error...
Status{statusCode=DEVELOPER_ERROR, resolution=null}在此行上....
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);请提出解决方案.
推荐答案您需要将SHA1密钥添加到Firebase控制台配置中. 您可以通过以下方式做到这一点:
You need to add your SHA1 key to firebase console configuration. You can do it in this way:
Firebase控制台( console.firebase.google )->您的项目- >配置->滚动到
Firebase console ( console.firebase.google ) -> your project -> configuration -> scroll to
您可以在Android Studio中找到运行签名报告"的SHA1密钥:
You can find your SHA1 key running "Signing report" from Android Studio:
然后,查看运行选项卡"并单击按钮:
Then, look the "run tab" and click the button:
我认为这是更简单的方法.希望有帮助.
I think it's the easier way. Hope this help.
更多推荐
错误:状态{statusCode = DEVELOPER
发布评论