public void SilentSignIn()
        {
            ITask <AuthAccount> taskAuthHuaweiId = authService.SilentSignIn();

            taskAuthHuaweiId.AddOnSuccessListener((result) =>
            {
                HuaweiId = result;
                OnSignInSuccess?.Invoke(result);
            }).AddOnFailureListener((exception) =>
            {
                HuaweiId = null;
                OnSignInFailed?.Invoke(exception);
            });
        }
Ejemplo n.º 2
0
        public void SilentSignIn()
        {
            ITask <AuthAccount> taskAuthHuaweiId = authService.SilentSignIn();

            taskAuthHuaweiId.AddOnSuccessListener((result) =>
            {
                HuaweiId = result;
                OnSignInSuccess?.Invoke(result);
            }).AddOnFailureListener((exception) =>
            {
                HuaweiId = null;
                Debug.LogError("[HMSAccountManager]: Silent Sign in failed. CauseMessage: " + exception.WrappedCauseMessage + ", ExceptionMessage: " + exception.WrappedExceptionMessage);
                OnSignInFailed?.Invoke(exception);
            });
        }
Ejemplo n.º 3
0
        public void Init()
        {
            Debug.Log("HMS GAMES init");
            authService = HMSAccountManager.Instance.GetGameAuthService();

            ITask <AuthAccount> taskAuthHuaweiId = authService.SilentSignIn();

            taskAuthHuaweiId.AddOnSuccessListener((result) =>
            {
                InitJosApps(result);
                SignInSuccess?.Invoke(result);
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("HMS GAMES: The app has not been authorized");
                authService.StartSignIn((auth) => { InitJosApps(auth); SignInSuccess?.Invoke(auth); }, SignInFailure);
                InitGameManagers();
            });
        }
        public void Init()
        {
            Debug.Log("HMS GAMES init");
            authService = HMSAccountManager.Instance.GetGameAuthService();

            ITask <AuthAccount> taskAuthHuaweiId = authService.SilentSignIn();

            taskAuthHuaweiId.AddOnSuccessListener((result) =>
            {
                HMSAccountManager.Instance.HuaweiId = result;
                Debug.Log("HMS GAMES: Setted app");
                IJosAppsClient josAppsClient = JosApps.GetJosAppsClient();
                Debug.Log("HMS GAMES: jossClient");
                josAppsClient.Init();
                Debug.Log("HMS GAMES: jossClient init");
                InitGameManagers();
                SignInSuccess?.Invoke(result);
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("HMS GAMES: The app has not been authorized");
                authService.StartSignIn(SignInSuccess, SignInFailure);
                InitGameManagers();
            });
        }