I would like to use GoogleSignIn and send email using android internal email address (gmail)
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
//.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.requestScopes(new Scope(GmailScopes.GMAIL_SEND) )
.build();
// Build a GoogleSignInClient with the options specified by gso.
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
dependencies {
implementation 'com.google.api-client:google-api-client:1.23.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
implementation 'com.google.apis:google-api-services-gmail:v1-rev83-1.23.0'
// ...
}
I setup in google console API key, for using gmail, and oauth adding my sh1.
- I dont know where to put the API key in the app
- Sign in with google works fine without
.requestScopes(new Scope(GmailScopes.GMAIL_SEND) )
But when I am adding it, it hangs forever.
