public GoogleApiClient GetGoogleApiClient(AppCompatActivity activity, GoogleApiClient.IOnConnectionFailedListener listener) { this.activity = activity; mGoogleApiClient = new GoogleApiClient.Builder(Application.Context) .EnableAutoManage(this.activity, listener) .AddApi(Auth.GOOGLE_SIGN_IN_API, GetGoogleSignInOptions()) .Build(); return(mGoogleApiClient); }
public void RegisterServiceForPlaform(object sender) { _geoList = new List <IGeofence>(); _geofencePendingIntent = null; PopulateGeofenceList(); _context = sender as Context; GoogleApiClient.IConnectionCallbacks connectionCallback = this as GoogleApiClient.IConnectionCallbacks; GoogleApiClient.IOnConnectionFailedListener connectionFailedCallback = sender as GoogleApiClient.IOnConnectionFailedListener; _googleApiClient = new GoogleApiClient.Builder(_context) .AddConnectionCallbacks(connectionCallback) .AddOnConnectionFailedListener(connectionFailedCallback) .AddApi(LocationServices.API) .Build(); }
public GoogleApiClient GoogleLogin(Context context, FragmentActivity fragmentActivity, GoogleApiClient.IOnConnectionFailedListener onConnectionFailedListener, GoogleApiClient.IConnectionCallbacks onconnectionCallbacks) { GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DefaultSignIn) .RequestEmail() .Build(); GoogleApiClient mgoogleApiClient = new GoogleApiClient.Builder(context) .EnableAutoManage(fragmentActivity, onConnectionFailedListener) .AddApi(Auth.GOOGLE_SIGN_IN_API, gso) .AddConnectionCallbacks(onconnectionCallbacks) .Build(); return(mgoogleApiClient); }