Ejemplo n.º 1
0
 public void InitSDK(object initData, Action <string, bool> callback)
 {
     if (mInitialized)
     {
         EB.Debug.Log("HuaweiSDKManager.InitSDK: Initialized");
         callback(null, true);
         return;
     }
     if (Application.platform != RuntimePlatform.Android)
     {
         callback(null, false);
         return;
     }
     EB.Debug.Log("HuaweiSDKManager.InitSDK: initData = {0}", JSON.Stringify(initData));
     appId          = EB.Dot.String("appId", initData, string.Empty);
     payId          = EB.Dot.String("payId", initData, string.Empty);
     buoyPrivateKey = EB.Dot.String("buoyPrivateKey", initData, string.Empty);
     EB.Debug.Log("HuaweiSDKManager.InitSDK: appId = {0}", appId);
     EB.Debug.Log("HuaweiSDKManager.InitSDK: payId = {0}", payId);
     EB.Debug.Log("HuaweiSDKManager.InitSDK: buoyPrivateKey = {0}", buoyPrivateKey);
     mInitCallback      += callback;
     Hub.RunInBackground = true;
     new GameObject("huawei_plugin_listener", typeof(SparxHuaweiSDKManager));
     HuaweiSDK.InitSDK(appId, payId, buoyPrivateKey);
 }
Ejemplo n.º 2
0
 public void OnLoginEnteredForeground()
 {
     if (mLoginCallback != null)
     {
         EB.Coroutines.SetTimeout(delegate()
         {
             if (mLoginCallback != null)
             {
                 HuaweiSDK.DestorySDK();
                 mInitialized  = false;
                 mInitCallback = null;
                 mLogined      = false;
                 HuaweiSDK.InitSDK(appId, payId, buoyPrivateKey);
                 System.Action <string, object> callback = mLoginCallback;
                 EB.Debug.Log("HuaweiSDKManager.OnLogin OnLoginEnteredForeground");
                 mLoginCallback = null;
                 callback(null, null);
             }
         }, 1 * 1000);
     }
 }