async void ProcessSignInResult(Intent data) { GoogleSignInResult signInResult = Auth.GoogleSignInApi.GetSignInResultFromIntent(data); if (signInResult.IsSuccess) { AuthCredential credential = GoogleAuthProvider.GetCredential(signInResult.SignInAccount.IdToken, null); try { User.PhotoPath = signInResult.SignInAccount.PhotoUrl.ToString(); User.Uid = signInResult.SignInAccount.Id; User.Token = signInResult.SignInAccount.IdToken; User.NickName = signInResult.SignInAccount.DisplayName; IAuthResult authResult = await FirebaseAuth_.SignInWithCredentialAsync(credential); FirebaseUser user = authResult.User; } catch (Exception ex) { // new Handler(MainLooper).Post(() => new AlertDialog.Builder(this).SetMessage("파이어베이스 등록 실패\n\n" + ex).Show()); } } else { } }
async void ProcessSignInResult(Intent data) { GoogleSignInResult signInResult = Auth.GoogleSignInApi.GetSignInResultFromIntent(data); if (signInResult.IsSuccess) { AuthCredential credential = GoogleAuthProvider.GetCredential(signInResult.SignInAccount.IdToken, null); try { IAuthResult authResult = await FirebaseAuth_.SignInWithCredentialAsync(credential); FirebaseUser user = authResult.User; User.myInfo.PhotoPath = signInResult.SignInAccount.PhotoUrl.ToString(); User.Uid = signInResult.SignInAccount.Id; User.Token = signInResult.SignInAccount.IdToken; User.myInfo.NickName = signInResult.SignInAccount.DisplayName; StartActivity(new Intent(Application.Context, typeof(MainActivity))); } catch (Exception ex) { // new Handler(MainLooper).Post(() => new Android.App.AlertDialog.Builder(this).SetMessage("var_TeamRecord 등록 실패\n\n" + ex).Show()); } } else { StartActivity(new Intent(Application.Context, typeof(MainActivity))); } }
protected override void OnDestroy() { base.OnDestroy(); FirebaseAuth_.SignOut(); // NetProcess.SendStopStream(); }
public void GoolgeLogout() { NetProcess.client.ClearSocket(); User.Clear(); FirebaseAuth_.SignOut(); Auth.GoogleSignInApi.SignOut(GoogleApiClient); Intent signInIntent = Auth.GoogleSignInApi.GetSignInIntent(GoogleApiClient); StartActivityForResult(signInIntent, SignInRequestCode); }
protected override void OnDestroy() { FirebaseAuth_.SignOut(); }