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