Пример #1
0
        public Task <GoogleLoginResult> SignIn()
        {
            var tcs = new TaskCompletionSource <GoogleLoginResult>();

            GoogleLoginActivity.OnLoginCompleted(tcs);
            var googleIntent = new Intent(Forms.Context, typeof(GoogleLoginActivity));

            Xamarin.Forms.Forms.Context.StartActivity(googleIntent);
            return(tcs.Task);
        }
        public async Task <bool> Logout()
        {
            try
            {
                GetFirebaseAuthInstance().SignOut();
                await GoogleLoginActivity.SignOut();

                return(true);
            }
            catch (Exception ex)
            {
                Log.Error("TOOLBELT", ex.ToString());
                this.Log().ErrorException("Error when logging out", ex);
                return(false);
            }
        }
Пример #3
0
        public static void GoogleLoginAsync(Action <GoogleLoginResult> callback)
        {
#if __ANDROID__
            GoogleLoginActivity.OnLoginCompleted(callback);
            var fbIntent = new Intent(Forms.Context, typeof(GoogleLoginActivity));
            Xamarin.Forms.Forms.Context.StartActivity(fbIntent);
#endif

            //#if __IOS__
            //            var loginResult = DependencyService.Get<IGoogleLogin>(DependencyFetchTarget.GlobalInstance);
            //            if (loginResult == null)
            //                return;

            //            var result = await loginResult.GoogleLogin();
            //            if (result == null)
            //                return;

            //            callback.Invoke(result);
            //#endif
        }