744 lines
		
	
	
		
			19 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			744 lines
		
	
	
		
			19 KiB
		
	
	
	
		
			C#
		
	
	
	
| #if UNITY_ANDROID
 | ||
| 
 | ||
| using System;
 | ||
| using System.Collections;
 | ||
| using System.Collections.Generic;
 | ||
| using UnityEngine;
 | ||
| 
 | ||
| namespace Touka
 | ||
| {
 | ||
|     /// <summary>
 | ||
|     /// TKG Native SDK Android platform interface call
 | ||
|     /// </summary>
 | ||
|     public class TKGNativeInterfaceAndroid : TKGNativeInterface
 | ||
|     {
 | ||
| 
 | ||
|         private AndroidJavaObject jo;
 | ||
| 
 | ||
|         public TKGNativeInterfaceAndroid()
 | ||
|         {
 | ||
|             // java interface class
 | ||
|             using (AndroidJavaClass jc = new AndroidJavaClass("com.touka.tkg.TKGProxyJava"))
 | ||
|             {
 | ||
|                 jo = jc.CallStatic<AndroidJavaObject>("getInstance");
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         private T SDKCall<T>(string _method, params object[] _param)
 | ||
|         {
 | ||
|             try
 | ||
|             {
 | ||
|                 return jo.Call<T>(_method, _param);
 | ||
|             }
 | ||
|             catch (Exception e)
 | ||
|             {
 | ||
|                 Debug.LogError(e);
 | ||
|             }
 | ||
|             return default(T);
 | ||
|         }
 | ||
| 
 | ||
|         private void SDKCall(string _method, params object[] _param)
 | ||
|         {
 | ||
|             try
 | ||
|             {
 | ||
|                 jo.Call(_method, _param);
 | ||
|             }
 | ||
|             catch (Exception e)
 | ||
|             {
 | ||
|                 Debug.LogError(e);
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
| #region init
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// init
 | ||
|         /// </summary>
 | ||
|         /// <param name="_initCallback"></param>
 | ||
|         public override void Init(Action _initCallback = null)
 | ||
|         {
 | ||
|             TKGDebugger.LogDebug("init ----- 00");
 | ||
|             base.Init(_initCallback);
 | ||
|             TKGDebugger.LogDebug("init ----- 01");
 | ||
|             SetBannerAdCallback(new AndroidBannerADTKGAdCallback());
 | ||
|             TKGDebugger.LogDebug("init ----- 01 ------- a");
 | ||
|             setInterstitalAdCallback(new AndroidInterADTKGAdCallback());
 | ||
|             TKGDebugger.LogDebug("init ----- 01 ------- b");
 | ||
|             SetRewardAdCallback(new AndroidRewardADTKGAdCallback());
 | ||
|             TKGDebugger.LogDebug("init ----- 01 ------- c");
 | ||
|             SetSDKCommonCallback(new AndroidTKGCommonCalllback());
 | ||
|             TKGDebugger.LogDebug("init ----- 01 ------- d");
 | ||
|             
 | ||
|             SDKCall("init", new AndroidProxyCallback());
 | ||
|             TKGDebugger.LogDebug("init ----- 02");
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Get Channel
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         public override string GetChannel()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             return SDKCall<string>("getChannel");
 | ||
| #endif
 | ||
|             return "AndroidRoot";
 | ||
|         }
 | ||
| 
 | ||
| #region Ads
 | ||
| 
 | ||
|         public override void PurchasedRemoveAds()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("purchasedRemoveAds");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         public override void SetUnitySDKVersion(string sdkVersion)
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setUnitySDKVersion","UnitySDK",sdkVersion);
 | ||
| #endif
 | ||
| 
 | ||
|         }
 | ||
| 
 | ||
| #region Ads Show
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show banner Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_bannerAlign">bannerAlign</param>
 | ||
|         public override void showBannerAd(TKGBannerAlign  _pos)
 | ||
|         {
 | ||
|             int _posIndex = 2;
 | ||
|             if(_pos == TKGBannerAlign.BannerCenterTopAlign)
 | ||
|             {
 | ||
|                 _posIndex = 1;
 | ||
| 
 | ||
|             }
 | ||
|             else if(_pos == TKGBannerAlign.BannerCenterBottomAlign)
 | ||
|             {
 | ||
|                 _posIndex = 2;
 | ||
|             }
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showBannerAd", _posIndex);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Hide Banner Ad
 | ||
|         /// </summary>
 | ||
|         public override void hideBannerAd()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("hideBannerAd");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         public override void RemoveNativeAd()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("hideNative");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Interstitial Ad
 | ||
|         /// </summary>
 | ||
|         public override void showInterstitialAd()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showInterstitialAd");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Interstitial Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_adPos"></param>
 | ||
|         public override void showInterstitialAd(string _adPos, IVADType _IvType = IVADType.IV1)
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showInterstitialAd", _adPos, (int)_IvType);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Reward Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_adPos"></param>
 | ||
|         /// <param name="_itemCount"></param>
 | ||
|         public override void showRewardAd(string _adPos, int _itemCount = -1)
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showRewardAd", _adPos, _itemCount);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Reward Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_adPos"></param>
 | ||
|         /// <param name="_itemCount"></param>
 | ||
|         /// <param name="_extraEvent"></param>
 | ||
|         public override void showRewardAd(string _adPos, int _itemCount, Dictionary<string, string> _extraEvent)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showRewardAd", _adPos, _itemCount, _extraEvent);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Video Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_adPos"></param>
 | ||
|         /// <param name="_itemCount"></param>
 | ||
|         public override void showVideoAd(string _adPos, int _itemCount = -1)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("showVideoAd", _adPos, _itemCount);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         public override void SetShowSDKToast(bool _useSDKToast)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setShowSDKRewardTips", _useSDKToast);
 | ||
| #endif
 | ||
| 
 | ||
|         }
 | ||
| 
 | ||
|         public override void ShowNativeAd(RectTransform pRect, Camera pCam = null, string pAdPos = "")
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             Vector3[] tWorldCorners = new Vector3[4];
 | ||
|             pRect.GetWorldCorners(tWorldCorners);
 | ||
| 
 | ||
|             Vector2 tTopLeft = RectTransformUtility.WorldToScreenPoint(pCam, tWorldCorners[1]);
 | ||
|             Vector2 tBottomRight = RectTransformUtility.WorldToScreenPoint(pCam, tWorldCorners[3]);
 | ||
|             float tWidth = Mathf.Abs(tBottomRight.x - tTopLeft.x);
 | ||
|             float tHeight = Mathf.Abs(tBottomRight.y - tTopLeft.y);
 | ||
|             // x , y , width , height
 | ||
|             // ((tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight)
 | ||
|             SDKCall("showNative", pAdPos, tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight, pAdPos);
 | ||
| #endif
 | ||
| 
 | ||
|         }
 | ||
| #endregion
 | ||
| 
 | ||
| 
 | ||
| #region Ads isready
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// banner isReady
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         public override bool isBannerAdReady()
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             bool isReady = SDKCall<bool>("isBannerAdReady");
 | ||
|             return isReady;
 | ||
| #else
 | ||
|             return false;
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Interstitial isReady
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         public override bool isInterstitialAdReady()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             bool isReady = SDKCall<bool>("isInterstitialAdReady");
 | ||
|             return isReady;
 | ||
| #else
 | ||
|             return false;
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Reward isReady
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         public override bool isRewardAdReady()
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             bool isReady = SDKCall<bool>("isRewardAdReady");
 | ||
|             return isReady;
 | ||
| #else
 | ||
|             return false;
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// FullScreen isReady
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         public override bool isVideoAdReady()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             bool isReady = SDKCall<bool>("isVideoAdReady");
 | ||
|             return isReady;
 | ||
| #else
 | ||
|             return false;
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         public override bool IsReadyNativeAd()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             bool isReady = SDKCall<bool>("isNativeReady");
 | ||
|             return isReady;
 | ||
| #else
 | ||
|             return false;
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region Set ads callback
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set Banner Ad Callback
 | ||
|         /// </summary>
 | ||
|         /// <param name="_bannerCallback"></param>
 | ||
|         public override void SetBannerAdCallback(AndroidBannerADTKGAdCallback _bannerCallback)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setBannerAdCallback", _bannerCallback);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set Interstital Ad Callback
 | ||
|         /// </summary>
 | ||
|         /// <param name="_interCallback"></param>
 | ||
|         public override void setInterstitalAdCallback(AndroidInterADTKGAdCallback _interCallback)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setInterstitalAdCallback", _interCallback);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set reward Ad Callback
 | ||
|         /// </summary>
 | ||
|         /// <param name="_rewardCallback"></param>
 | ||
|         public override void SetRewardAdCallback(AndroidRewardADTKGAdCallback _rewardCallback)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setRewardAdCallback", _rewardCallback);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set video Ad Callback(full screen ad, reward ad with no reward callback)
 | ||
|         /// </summary>
 | ||
|         /// <param name="_videoCallback"></param>
 | ||
|         public override void setVideoAdCallback(AndroidInterADTKGAdCallback _videoCallback)
 | ||
|         {
 | ||
| 
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("setVideoAdCallback", _videoCallback);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region load ads
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// load interstitial ad
 | ||
|         /// (retry 3 times, per time interval 10s)
 | ||
|         /// </summary>
 | ||
|         public override void loadInterstitialAD()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("loadInterstitialAD");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// load reward ad
 | ||
|         /// (retry 3 times, per time interval 10s)
 | ||
|         /// </summary>
 | ||
|         public override void loadRewardAD()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("loadRewardAD");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// load video ad
 | ||
|         /// (retry 3 times, per time interval 10s)
 | ||
|         /// </summary>
 | ||
|         public override void loadVideoAD()
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("loadVideoAD");
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| 
 | ||
| #region Log Event
 | ||
| 
 | ||
| #region Normal
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// onEvent
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventName"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override void onEvent(string _eventName)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("onEvent", _eventName);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// onEvent
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventName"></param>
 | ||
|         /// <param name="_key01"></param>
 | ||
|         /// <param name="_value01"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override void onEvent(string _eventName, string _key01, string _value01)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("onEvent", _eventName, _key01, _value01);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// onEvent
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventName"></param>
 | ||
|         /// <param name="_key01"></param>
 | ||
|         /// <param name="_value01"></param>
 | ||
|         /// <param name="_key02"></param>
 | ||
|         /// <param name="_value02"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override void onEvent(string _eventName, string _key01, string _value01, string _key02, string _value02)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("onEvent", _eventName, _key01, _value01, _key02, _value02);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// onEvent
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventName"></param>
 | ||
|         /// <param name="_keyValues"></param>
 | ||
|         public override void onEvent(string _eventName, Dictionary<string, string> _keyValues)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("onEvent", _eventName, Analytics.ToJavaHashMap(_keyValues));
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region Level Event
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Level Start
 | ||
|         /// </summary>
 | ||
|         /// <param name="_levelId"></param>
 | ||
|         public override void LevelStart(string _levelId)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("levelStart", _levelId);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Level end
 | ||
|         /// </summary>
 | ||
|         /// <param name="_levelId"></param>
 | ||
|         /// <param name="_stageResult"></param>
 | ||
|         public override void LevelEnd(string _levelId, StageResult _stageResult)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("levelEnd", _levelId, (int)_stageResult);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region Tracking Event
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Log Tracking Event
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventType"></param>
 | ||
|         public override void LogTrackingEvent(TrackingEventType _eventType)
 | ||
|         {
 | ||
| #if UNITY_ANDROID
 | ||
|             SDKCall("LogTrackingEvent", (int)_eventType);
 | ||
| #endif
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region Online Config
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - int
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override int GetConfigInt(string _key, int _default)
 | ||
|         {
 | ||
|             TKGDebugger.LogDebug("int _key : " + _key + " , _default : " + _default);
 | ||
|             int newValue = SDKCall<int>("getConfigInt", _key, _default);
 | ||
|             return newValue;
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - string
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override string GetConfigString(string _key, string _default)
 | ||
|         {
 | ||
|             TKGDebugger.LogDebug("string _key : " + _key + " , _default : " + _default);
 | ||
|             string newValue = SDKCall<string>("getConfigString", _key, _default);
 | ||
|             return newValue;
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - bool
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         public override bool GetConfigBool(string _key, bool _default)
 | ||
|         {
 | ||
|             TKGDebugger.LogDebug("bool _key : " + _key + " , _default : " + _default);
 | ||
|             bool newValue = SDKCall<bool>("getConfigBool", _key, _default);
 | ||
|             return newValue;
 | ||
|         }
 | ||
| 
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region Others (Common)
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// review
 | ||
|         /// </summary>
 | ||
|         public override void Review()
 | ||
|         {
 | ||
|             SDKCall("review");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open Privacy
 | ||
|         /// </summary>
 | ||
|         public override void OpenPrivacyURL()
 | ||
|         {
 | ||
|             SDKCall("openPrivacy");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open agreement
 | ||
|         /// </summary>
 | ||
|         public override void OpenUserTermURL()
 | ||
|         {
 | ||
|             SDKCall("openAgreement");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open policy pop
 | ||
|         /// </summary>
 | ||
|         public override void OpenPolicyPop()
 | ||
|         {
 | ||
|             SDKCall("openPrivacyDialog");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// More Games
 | ||
|         /// </summary>
 | ||
|         public override void OpenMoreGame()
 | ||
|         {
 | ||
|             SDKCall("moreGames");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set Log Enable
 | ||
|         /// </summary>
 | ||
|         /// <param name="_enable"></param>
 | ||
|         public override void SetLogEnable(bool _enable)
 | ||
|         {
 | ||
|             SDKCall("setEnableLog", _enable);
 | ||
|         }
 | ||
| #endregion
 | ||
| 
 | ||
| #region Others (Uncommon)
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// shake(no repeat)
 | ||
|         /// </summary>
 | ||
|         /// <param name="_shakeTime"> shake time </param>
 | ||
|         public override void shake(int _shakeType, float _intensity = 1)
 | ||
|         {
 | ||
|             long tShakeMS = _shakeType * _shakeType * 20 + (int)(_intensity * (_shakeType + 1) * 10);
 | ||
|             SDKCall("shake", tShakeMS);
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// shake(can repeat)
 | ||
|         /// </summary>
 | ||
|         /// <param name="_repeatTimes"> repeat times : -1 </param>
 | ||
|         /// <param name="_shakeTime"> wait time,shake time(100,1000,100,111)</param>
 | ||
|         //public override void shake(int _repeatTimes, params int[] _shakeTime)
 | ||
|         //{
 | ||
|         //    SDKCall("shake", _repeatTimes, _shakeTime);
 | ||
|         //}
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// cancel shake
 | ||
|         /// </summary>
 | ||
|         public override void cancelShake()
 | ||
|         {
 | ||
|             SDKCall("cancelShake");
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Tips
 | ||
|         /// Pop-up prompt (the one with black transparent background) unified style, Chinese, Japanese, Korean and English, support multi-language, multi-language text
 | ||
|         ///
 | ||
|         /// game judges different languages by itself and passes different strings
 | ||
|         /// </summary>
 | ||
|         /// <param name="_titleStr"> title </param>
 | ||
|         /// <param name="_contentStr"> content </param>
 | ||
|         public override void dialogTips(string _titleStr, string _contentStr = "")
 | ||
|         {
 | ||
|             SDKCall("dialogTips", _titleStr);
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Open ULR by Browser
 | ||
|         /// </summary>
 | ||
|         /// <param name="_url"></param>
 | ||
|         public override void openUrlBrowser(string _url)
 | ||
|         {
 | ||
|             SDKCall("openUrlBrowser", _url);
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Open ULR By WEB POP
 | ||
|         /// </summary>
 | ||
|         /// <param name="_url"></param>
 | ||
|         public override void openWebUrl(string _url)
 | ||
|         {
 | ||
|             SDKCall("openWebUrl", _url);
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// show Toast
 | ||
|         /// </summary>
 | ||
|         /// <param name="_content"></param>
 | ||
|         public override void toast(string _content)
 | ||
|         {
 | ||
|             SDKCall("dialogTips",_content);
 | ||
|         }
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// push message
 | ||
|         /// </summary>
 | ||
|         public override void pushMsg()
 | ||
|         {
 | ||
|             SDKCall("pushMsg");
 | ||
|         }
 | ||
| 
 | ||
|         // <summary>
 | ||
|         /// share txt
 | ||
|         /// </summary>
 | ||
|         /// <param name="_shareTxt"></param>
 | ||
|         public override void ShareTxt(string _shareTxt)
 | ||
|         {
 | ||
|             SDKCall("localShareTxt", _shareTxt);
 | ||
|         }
 | ||
| 
 | ||
|         public override void RegistAPNS()
 | ||
|         {
 | ||
|             
 | ||
|         }
 | ||
| 
 | ||
|         public override void RegistNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle)
 | ||
|         {
 | ||
|            SDKCall("registNotification",notiId,body,fireDate,badge,title,subTitle);
 | ||
|         }
 | ||
| 
 | ||
|         public override void RemoveNotification(string notiId)
 | ||
|         {
 | ||
|             SDKCall("removeNotification", notiId);
 | ||
|         }
 | ||
| 
 | ||
|         public override void RemoveAllNotifications()
 | ||
|         {
 | ||
|             SDKCall("removeAllNotifications");
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
| #region common callback
 | ||
| 
 | ||
|         public override void SetSDKCommonCallback(AndroidTKGCommonCalllback _commonCallback)
 | ||
|         {
 | ||
|             SDKCall("setTkgCallback", _commonCallback);
 | ||
|         }
 | ||
| 
 | ||
|         public override void SetUserSourceCallback(AndroidTKGUserSourceCalllback _userSourceCallback)
 | ||
|         {
 | ||
|             SDKCall("getUserSource", _userSourceCallback);
 | ||
|         }
 | ||
| 
 | ||
| 
 | ||
|         public override void SetUserSourceCallback(AndroidTKGUserSourceCalllbackWithCampaignName _userSourceCallback)
 | ||
|         {
 | ||
|             SDKCall("getUserSource", _userSourceCallback);
 | ||
|         }
 | ||
| 
 | ||
|         public override void SetFunctionSwitchCalllback(List<FunctionType> _functionKeys, AndroidFunctionSwitchCalllback _functionSwitchCalllback)
 | ||
|         {
 | ||
| 
 | ||
|             string keys="";
 | ||
| 
 | ||
|             for (int i = 0; i < _functionKeys.Count; i++)
 | ||
|             {
 | ||
|                 FunctionType enumType = _functionKeys[i];
 | ||
|                 string enumTypeString = enumType.ToString();
 | ||
|                 if(keys!=""){
 | ||
|                     keys=keys+"@";
 | ||
|                 }
 | ||
|                  keys=keys+enumTypeString;
 | ||
|             }
 | ||
| 
 | ||
|             SDKCall("setGameSwitchListener", keys,_functionSwitchCalllback);
 | ||
|         }
 | ||
| 
 | ||
| #endregion
 | ||
| 
 | ||
|     }
 | ||
| }
 | ||
| 
 | ||
| #endif |