/** * Starts the sign-in process and initializes the Drive client. */ private void signIn() { GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(Drive.SCOPE_FILE) .requestScopes(Drive.SCOPE_APPFOLDER) .build(); GoogleSignInClient googleSignInClient = GoogleSignIn.getClient(this, signInOptions); startActivityForResult(googleSignInClient.getSignInIntent(), REQUEST_CODE_SIGN_IN); }
@Override public void onAttach(Context context) { super.onAttach(context); GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken("YOUR_REQUEST_ID_TOKEN") .requestEmail() .build(); mGoogleSignInClient = GoogleSignIn.getClient(context, gso); mAuth = FirebaseAuth.getInstance(); }
.build(); mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_in); mAuth = FirebaseAuth.getInstance(); GoogleSignInOptions mGso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.google_web_client_id)) .requestEmail() .build(); mGoogleSignInClient = GoogleSignIn.getClient(this, mGso); mProgressBar = findViewById(R.id.pb_signin); PresenterInjector.injectSignInPresenter(this); findViewById(R.id.google_signin_btn).setOnClickListener(v -> mPresenter.handleLoginRequest()); extras = getIntent().getExtras(); mPresenter.start(extras); }
public void backuptodrive(String path) { GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(Drive.SCOPE_FILE, Drive.SCOPE_APPFOLDER) .requestIdToken("YOUR_REQUEST_ID_TOKEN") .build(); mGoogleSignInClient = GoogleSignIn.getClient(getContext(), signInOptions); Intent signInIntent = mGoogleSignInClient.getSignInIntent(); startActivityForResult(signInIntent, RC_SIGN_IN); tmppath = path; }
public void downloadinit() { GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(Drive.SCOPE_FILE, Drive.SCOPE_APPFOLDER) .requestIdToken("YOUR_REQUEST_ID_TOKEN") .build(); mGoogleSignInClient = GoogleSignIn.getClient(getContext(), signInOptions); Intent signInIntent = mGoogleSignInClient.getSignInIntent(); startActivityForResult(signInIntent, RC_SIGN_IN_DOWNLOAD); }
super.onCreate(savedInstanceState); setContentView(R.layout.main); mGoogleSignInClient = GoogleSignIn.getClient(this, new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN) .requestScopes(Drive.SCOPE_APPFOLDER)
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
public void signupUsingGoogleAccount(int mifosSavingsProductId) { showProgressDialog(Constants.PLEASE_WAIT); mMifosSavingProductId = mifosSavingsProductId; GoogleSignInOptions gso = new GoogleSignInOptions.Builder( GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id)) .requestEmail() .build(); googleSignInClient = GoogleSignIn.getClient(this, gso); Intent signInIntent = googleSignInClient.getSignInIntent(); hideProgressDialog(); startActivityForResult(signInIntent, 11); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id)) .requestEmail() .build(); mGoogleSignInClient = GoogleSignIn.getClient(this, gso); mFirebaseAuth = FirebaseAuth.getInstance(); FirebaseUser user = mFirebaseAuth.getCurrentUser(); if (user != null) { showDashboard(); } mGoogleSignInButton = findViewById(R.id.google_sign_in_button); mGoogleSignInButton.setSize(SignInButton.SIZE_WIDE); mGoogleSignInButton.setOnClickListener(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signin); final GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id)) .requestEmail() .build(); mGoogleSigninClient = GoogleSignIn.getClient(this, gso); mHelpers = new Helpers(this); mFirebaseAuth = FirebaseAuth.getInstance(); FirebaseUser user = mFirebaseAuth.getCurrentUser(); if (user != null) { navigateToHome(); } mFirebaseDatabase = FirebaseDatabase.getInstance(); SignInButton mGoogleSignInButton = findViewById(R.id.sign_in_goggle_button); mGoogleSignInButton.setSize(SignInButton.SIZE_WIDE); mGoogleSignInButton.setColorScheme(SignInButton.COLOR_DARK); mEmailText = findViewById(R.id.sign_in_email_tv); mPasswordText = findViewById(R.id.sign_in_password_tv); mGoogleSignInButton.setOnClickListener(this); findViewById(R.id.sign_in_button).setOnClickListener(this); findViewById(R.id.sign_in_register_tv).setOnClickListener(this); findViewById(R.id.sign_in_forgot_pass_tv).setOnClickListener(this); }
.build(); final GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
GoogleSignIn.getClient(mContext, signInOptionsBuilder.build()); signInClient.silentSignIn() .continueWith(mExecutorService,