Google coordinate authentication

前端 未结 3 817
再見小時候
再見小時候 2020-12-01 15:40

When I try to connect to Google coordinate, I always get an exception GoogleAuthException.

I have a Google Maps Coordinate license. I did create my clie

3条回答
  •  时光说笑
    2020-12-01 16:06

    The question is why do you need to get a token. As you commented in my question, you should be fine with GoogleAccountCredential object. Once you have the credential object, you can make calls to Google APIs

      credential = GoogleAccountCredential.usingOAuth2(this, scopes);
                    if (TextUtils.isEmpty(appPreferences.getUserName()))
                    {
                            try
                            {
    
                                    startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);
                            }
                            catch (ActivityNotFoundException e)
                            {
    
                                    Toast.makeText(this, getString(R.string.gps_missing), Toast.LENGTH_LONG).show();
    
                                    return;
                            }
    
                    }
    

提交回复
热议问题