public void Authenticate(Action <AuthServiceResult> callback)
        {
            if (!m_initialized)
            {
                Debug.Log("AppGalleryService -> CreateAuthParams");
                var authParams = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME).SetIdToken().SetAccessToken().CreateParams();
                Debug.Log("AppGalleryService -> GetService");
                m_authService = HuaweiIdAuthManager.GetService(authParams);

                m_initialized = true;
            }

            Debug.Log("AppGalleryService -> Start SignOut");
            var signOut = m_authService.SignOut();

            signOut.AddOnSuccessListener(success =>
            {
                Debug.Log($"AppGalleryService -> SignOut Success");
                SignIn(callback);
            });
            signOut.AddOnFailureListener(error =>
            {
                Debug.Log($"AppGalleryService -> SignOut Error {error.Message}");
                SignIn(callback);
            });
        }
 // Start is called before the first frame update
 void Awake()
 {
     Debug.Log("[HMS]: AWAKE AUTHSERVICE");
     authService      = DefaultAuthService;
     authServiceDrive = DefaultDriveAuthService;
     //For Game
 }
Esempio n. 3
0
 private void InitHuaweiAuthService()
 {
     if (_authService == null)
     {
         var authParams = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME).SetIdToken().CreateParams();
         _authService = HuaweiIdAuthManager.GetService(authParams);
         Debug.Log(TAG + " authservice is assigned.");
     }
 }
Esempio n. 4
0
        private void Init()
        {
            Debug.Log("HMS GAMES init");
            authService = accountManager.GetGameAuthService();

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

            taskAuthHuaweiId.AddOnSuccessListener((result) =>
            {
                accountManager.HuaweiId = result;
                Debug.Log("HMS GAMES: Setted app");
                IJosAppsClient josAppsClient = JosApps.GetJosAppsClient(accountManager.HuaweiId);
                Debug.Log("HMS GAMES: jossClient");
                josAppsClient.Init();
                Debug.Log("HMS GAMES: jossClient init");
                InitGameMAnagers();
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("HMS GAMES: The app has not been authorized");
                authService.StartSignIn(SignInSuccess, SignInFailure);
                InitGameMAnagers();
            });
        }
 // Start is called before the first frame update XPH0219227000019
 void Awake()
 {
     Debug.Log("[HMS]: AWAKE AUTHSERVICE");
     authService = DefaultAuthService;
 }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     authService = DefaultAuthService;
 }