using System; using System.Collections.Generic; using UnityEngine; namespace Touka { public interface ITKGSDK { /// /// init sdk /// void InitSDK(Action _initCallback = null); /// /// Set game focus /// /// void SetGameFocusListener(Action _gameFocusAction); /// /// Set reward click listener /// void SetRewardClickListener(Action _rewardClickAction); /// /// Get channel /// /// AppChannel GetChannel(); #region Ads // remove all ads void PurchasedRemoveAds(); /// /// Remove Native Ad /// void RemoveNativeAd(); /// /// Is Ready Native Ad /// /// bool IsReadyNativeAd(); /// /// Show Native Ad /// /// position void ShowNativeAd(RectTransform pRect, Camera pCam = null, string pAdPos = ""); /// /// Show banner /// /// 1:top,2:bottom void ShowBanner(TKGBannerAlign _bannerAlign); /// /// Hide banner /// void HideBanner(); /// /// Show Interstitial Ad /// /// Name of interstitial ad placement. /// Callback of interstitial ad close and show interstitial failed /// IVADType for distinguish interstitial ads frequency, default use iv1 void ShowInterstitialAd(string _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1); /// /// Show Reward Ad /// /// Name of reward ad placement /// true:reward succ, false: reward failed /// Callback of reward ad show fail void ShowRewardAd(string _adPos, Action _rewardCallback = null, Action _showFailedCallback = null); /// /// SetShowSDKToast /// if use sdk toast set true else set false void SetShowSDKToast(bool _useSDKToast); /// /// Is Ready Reward /// /// bool IsReadyRewardAd(); /// /// Is Ready Interstitial /// /// bool IsReadyInterstitialAd(); #endregion #region Log Event #region Normal /// /// log event /// /// void LogEvent(string _eventSort); /// /// log event /// /// /// /// void LogEvent(string _eventSort, string _key, string _value); /// /// log event /// /// /// /// /// /// void LogEvent(string _eventSort, string _key01, string _value01, string _key02, string _value02); /// /// log event /// /// /// void LogEvent(string _eventSort, Dictionary _eventDic = null); #endregion #region Level Event /// /// Notify game start /// /// void LevelStart(int _level); /// /// Notify game start /// /// void LevelStart(string _level); /// /// Notify game end /// /// /// bool LevelEnd(int _level, StageResult _stageResult); /// /// Notify game end /// /// /// bool LevelEnd(string _level, StageResult _stageResult); #endregion #region Reward Ad Button Show /// /// Log Reward ad button show /// /// void LogRewardAdBtnShow(string _pos); #endregion #region Tracking Event ///// ///// Log Tracking Event ///// ///// //void LogTrackingEvent(TrackingEventType _eventType); #endregion #endregion #region Online Config /// /// get config - string /// /// /// string GetConfigStr(string _key); /// /// get config - int /// /// /// int GetConfigInt(string _key); /// /// get config - bool /// /// /// bool GetConfigBool(string _key); #endregion #region Others(common) /// /// review /// void Review(); /// /// open privacy url /// void OpenPrivacyURL(); /// /// open user term url /// void OpenUserTermURL(); /// /// open more game /// void OpenMoreGame(); /// /// open browser url /// /// void OpenUrlByBrowser(string _url); void OpenPolicyPop(); void Toast(string _text); /// /// shake /// /// 0 light,1 medium,2 heavy /// ios 0~1, android any num void Shake(int _shakeType, float _intensity = 1); #endregion #region Others (unCommon) /// /// Set game focus /// /// void SetUserSourceListener(Action _userSourceAction); /// /// Set game focus /// /// void SetUserSourceListener(Action _userSourceActionWithCampaignName); /// /// 注册功能开关回调 /// /// 各功能名称 /// 回调事件,回来每个功能名称及对应开关 void SetFunctionSwitchListener(List _functionKeys, Action _functionSwitchCallback); /// /// common callback /// /// void SetTKGCommonCallback(Action _commonCallback); /// /// set log enable /// /// void SetLogEnable(bool _enable); /// /// share txt /// /// void ShareTxt(string _shareTxt); /// /// show picture cross /// bool showPictureCross(); /// /// remove picture cross /// void removePictureCross(); /// /// show more game icon /// bool showMoreGameIcon(); /// /// remove more game icon /// void removeMoreGameIcon(); /// /// regist APNS /// void RegistAPNS(); /// /// shake /// /// notification identifier /// The body of the notification. /// notify after the time interval. format: yyyy-MM-dd HH:mm:ss /// The application badge number. /// The title of the notification. /// The subtitle of the notification. void RegistNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle); /// /// remove all notification /// void RemoveAllNotifications(); /// /// remove notification by notification identifier /// /// notification identifier void RemoveNotification(string notiId); /// /// if is debug mode /// bool IsDebugMode(); /// /// get user name and user id card /// string GetUserNameAndUserIDCard(); /// /// set segment type to sdk /// /// segment type void SetSegment(SegmentType type); /// /// get a iap product list for sdk config file /// Dictionary GetIAPProductList(); #endregion #region 数据中台 void LogPurchasePrice(string price,string currency); void LogRobuxCashOut(); void LogNoviceGuideFinish(); #endregion #region GooglePlay评论引导 /// /// Pop up GooglePlay Rate guid /// bool GuidGpComment(); #endregion #region 用户登录 /// /// User Login /// 登录回调Action<登录状态码,登录类型,登录状态信息,userid,token,邮箱 , 显示名称 , 头像url> /// void Login(LoginType loginType, Action _loginResultCallback = null); /// /// Logout /// void Logout(Action _logoutCallback = null); /// /// Obtain a list of login channels, /// and the game displays the obtained login list for users to choose to log in. /// /// available login channels List AvailableLoginChannelList(); /// /// user actively deletes account. /// /// Return the deleted userId. If the game needs to record it, you can operate it in the action. /// /// Delete userId void DeleteAccount(Action _deleteAccountCallback = null); void BindAccount(LoginType type, BindType isForce, string userId, Action bindAccountCallback); void AutoLogin( Action loginResultCallback); LoginType GetAccountType(); bool IsCanAutoLogin(); #endregion #region IAP Event /// /// Log IAP button show /// /// Product name (customized on the game side) English name of the product cannot contain special characters ex: Gem100 /// Product ID: The ID of a specific product type void LogIAPBtnShow(string _productName,string _productID); /// /// Log IAP button Click /// /// Product name (customized on the game side) English name of the product cannot contain special characters ex: Gem100 /// Product ID: The ID of a specific product type void LogIAPBtnClick(string _productName, string _productID); /// /// Log IAP First payment successful /// /// Product name (customized on the game side) English name of the product cannot contain special characters ex: Gem100 /// Product ID: The ID of a specific product type /// The order id returned by the payment channel /// Currency ex:USD /// Price void LogIAPFirstPurchase(string _iap, string _id,string _paymentChannelOrderid, string _currency, string _price); /// /// Log IAP payment successful /// /// Product name (customized on the game side) English name of the product cannot contain special characters ex: Gem100 /// Product ID: The ID of a specific product type /// The order id on the game side /// The order id returned by the payment channel /// Purchase token: When the purchase is successful on GP, ​​a purchase token will be generated as a unique identifier /// Official payment channels: appstore, googleplay, other payment channels corresponding channel name /// Currency ex:USD /// Price void LogIAPSuccess(string _iap, string _id, string _gameOrderid, string _paymentChannelOrderid, string _productToken, string _paymentMethod, string _currency, string _price); #endregion #region 保存数据 void SaveCloudArchiving(string content, Action callback); void DetailCloudArchiving(Action callback); #endregion } public enum LoginType { // 游客登录 LOGIN_BY_GUESTER = 0, // 邮箱账号登录(暂不支持) LOGIN_BY_EMAIL = 1, // Google登录 LOGIN_BY_GOOGLE = 2, // Facebook登录 LOGIN_BY_FACEBOOK = 3, LOGIN_BY_Apple = 4, LOGIN_BY_AUTO = 10, } public enum BindAccountStatus { // 绑定失败 BIND_CODE_FAILED = -1, // 绑定成功 BIND_CODE_SUCC = 0, // 取消绑定 BIND_CODE_CANCEL = 1, // 已经绑定账户,需要选择 BIND_CODE_SELECT = 2, } public enum BindType { NO_FORCE = 0, FORCE = 1, } public enum DeleteStatus { DELETE_ACCOUNT_SUCC = 0, DELETE_ACCOUNT_CANCEL = 1, DELETE_ACCOUNT_FAILED = -1 } public enum LoginStatus { // 登录成功 LOGIN_STATUS_SUCC = 0, // 登录被用户取消 LOGIN_STATUS_CANCEL = 1, // 自动登陆没有缓存数据 LOGIN_STATUS_NO_CACHE = 2, // 登录失败 LOGIN_STATUS_FAILED = -1 } public enum SegmentType { Purchase, T0, T1, T2, Other1, Other2, Other3, Other4, Other5, Other6, Other7, Other8, Other9 } /// /// 功能名称枚举 /// public enum FunctionType { Function_wangz, Function_bing, Function_IA, Function_IP, Function_name, Function_other1, Function_other2, Function_other3 } /// /// IV Ad Type /// Control different frequency interstitial Ads /// public enum IVADType { IV1 = 0, IV2, IV3, IV4, IV5, IV6, IV7, iv8, MAX, } /// /// Tracking Event Type /// public enum TrackingEventType { GuildStart = 0, // guide start show GuildEnd = 1, // guild end FirstOperateGame = 2, // user operates the game for the first time Max, } /// /// ad show failed code type /// public enum AdShowFailCodeType { AdShowFailReal = 57, // ad real show failed AdIsNotReady = 58, // The ad component is displayed and found not ready AdIsReadyCannotShow = 59, // When the ad component is displayed, the ad is ready, but the rule that cannot display the ad is triggered } /// /// banner align /// public enum TKGBannerAlign : int { BannerCenterBottomAlign = 34, BannerCenterTopAlign = 10, } /// /// tkg common callback code /// public enum CommonCallbackCode { FirebaseOnlineParamGet_Succ = 990001, FirebaseOnlineParamGet_Failed = 990002, SaveCloudArchiving_Succ = 100, SaveCloudArchiving_Fail = 101, DetailCloudArchiving_Succ = 102, DetailCloudArchiving_Fail = 103, } /// /// stage result /// public enum StageResult { StageSucc = 0, StageFail = 1, StageRetry = 2, StageBack = 3, } /// /// app channel /// public enum AppChannel { None, AppStore_GB, AppStore_CN, GooglePlay, DY012, GW002, HY003, OP004, VO005, XM006, HW007, TX008, TP009, MM010, ZX011, KS012, PJ000, AndroidRoot = 10000 } public enum AdsType { None, Banner, IV, RV, Native, Splash, } public enum ThirdAccountType { None, Paypal } public enum IAPClientFailReasonType { None, NotInit, PurchaseFailed, Deferred } }