Exemplo n.º 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);
        }
Exemplo n.º 2
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
        }