Exemplo n.º 1
0
        public void GetToken()
        {
            string appId = AGConnectServicesConfig.fromContext(new Context()).getString("client/app_id");
            string token = HmsInstanceId.getInstance(new Context()).getToken(appId, "HCM");

            TestTip.Inst.ShowText(token);
            GUIUtility.systemCopyBuffer = token;
        }
Exemplo n.º 2
0
 public void SetAAID(bool isGet)
 {
     if (isGet)
     {
         Task id = HmsInstanceId.getInstance(new Context()).getAAID();
         id.addOnSuccessListener(new HmsSuccessListener <AAIDResult>((aaidResult) =>
         {
             String aaId = aaidResult.getId();
             TestTip.Inst.ShowText("getAAID success:" + aaId);
         })).addOnFailureListener(new HmsFailureListener((e) =>
         {
             TestTip.Inst.ShowText($"getAAID failed: {e.toString()}");
         }));
     }
     else
     {
         try {
             HmsInstanceId.getInstance(new Context()).deleteAAID();
             TestTip.Inst.ShowText("delete aaid and its generation timestamp success.");
         } catch (System.Exception e) {
             TestTip.Inst.ShowText("deleteAAID failed. " + e);
         }
     }
 }
Exemplo n.º 3
0
        public void DeleteToken()
        {
            string appId = AGConnectServicesConfig.fromContext(new Context()).getString("client/app_id");

            HmsInstanceId.getInstance(new Context()).deleteToken(appId, "HCM");
        }