public bool haveCurrentUser(AbstractPanel parentPanel) { AGConnectUser user = AGConnectAuth.getInstance().getCurrentUser(); if (user.getUid() == null || user.getUid() == "") { return(false); } ParentPanel = parentPanel; PanelController.getInstance() .OpenPanel(PanelController.getInstance().GetComponentInChildren <UserAccount>()); return(true); }
public override void OpenPanel() { base.OpenPanel(); clearTextValue(); try { agConnectUser = AGConnectAuth.getInstance().getCurrentUser(); if (agConnectUser != null) { UserNikeName.text = agConnectUser.getDisplayName(); UserEmail.text = agConnectUser.getEmail(); UserPhoneNumber.text = agConnectUser.getPhone(); photoUrl.text = agConnectUser.getPhotoUrl(); UserId.text = agConnectUser.getUid(); UserProviderId.text = agConnectUser.getProviderId(); UserProviderInfo.text = transferProviderInfo(agConnectUser.getProviderInfo()); agConnectUser.getToken(false).addOnSuccessListener(new HuaweiOnsuccessListener <TokenResult>( (result) => { UnityMainThread.instance.AddJob(() => { UserToken.text = result.getToken() + " " + result.getExpirePeriod(); }); } )); agConnectUser.getUserExtra().addOnSuccessListener(new HuaweiOnsuccessListener <AGConnectUserExtra>( (UserExtraInfo) => { UnityMainThread.instance.AddJob(() => { UserExtra.text = UserExtraInfo.getCreateTime() + " " + UserExtraInfo.getLastSignInTime(); }); })); isAnonymous.text = agConnectUser.isAnonymous() ? "true" : "false" + " " + agConnectUser.getEmailVerified() + " " + agConnectUser.getPasswordSetted(); } } catch (System.Exception e) { Error error = new Error(); error.message = e.Message; Debug.Log("this error is " + error.message); PanelController.popupinstance.ShowError(error); } }