// Make sure user already signed in! public void Start() { Debug.Log("HMS GAMES: Game init"); HuaweiMobileServicesUtil.SetApplication(); accountManager = AccountManager.Instance; Init(); }
public void Start() { HuaweiMobileServicesUtil.SetApplication(); if (HMSGameServiceSettings.Instance.Settings.GetBool(HMSGameServiceSettings.InitializeOnStart)) { Init(); } }
public void AuthenticateUser(Action <bool> callback = null) { if (!IsAuthenticated()) { _authService.StartSignIn(authId => { Debug.Log(TAG + ": Signed In Succesfully!"); commonAuthUser = new CommonAuthUser { email = authId.Email, name = authId.DisplayName, id = authId.OpenId, photoUrl = authId.AvatarUriString }; PlayerPrefs.SetInt("autoLogin", 1); HuaweiId = authId; Debug.Log(TAG + ": HuaweiIdToken is " + HuaweiId.IdToken); //Load IJosAppClient for HMS HuaweiMobileServicesUtil.SetApplication(); IJosAppsClient josAppsClient = JosApps.GetJosAppsClient(HuaweiId); josAppsClient.Init(); _rankingClient = Games.GetRankingsClient(HuaweiId); _achievementClient = Games.GetAchievementsClient(HuaweiId); callback?.Invoke(true); }, (error) => { commonAuthUser = null; callback?.Invoke(false); }); } }