2022-06-13 07:55:30 +00:00
#if UNITY_IPHONE
2022-08-30 02:21:29 +00:00
using System ;
2022-06-13 07:55:30 +00:00
using System.Collections ;
using System.Collections.Generic ;
using UnityEngine ;
2022-08-30 02:21:29 +00:00
namespace Touka
{
2022-06-13 07:55:30 +00:00
/// <summary>
/// TKG Native SDK iOS platform interface call
/// </summary>
public class TKGNativeInterfaceIOS : TKGNativeInterface
{
2022-08-30 02:21:29 +00:00
public override void Init ( Action _initCallback = null )
{
base . Init ( _initCallback ) ;
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . InitSDK ( ) ;
#endif
}
2022-06-13 07:55:30 +00:00
/// <summary>
/// Get Channel
/// </summary>
/// <returns></returns>
public override string GetChannel ( )
{
2023-09-12 09:23:21 +00:00
return TGiOSAdManager . Instance . getChannel ( ) . ToString ( ) ;
2022-08-30 02:21:29 +00:00
}
/// <summary>
/// Set Log Enable
/// </summary>
/// <param name="_enable"></param>
public override void SetLogEnable ( bool _enable )
{
TGiOSAdManager . Instance . SetLogEnable ( _enable ) ;
}
#region Ads
public override void PurchasedRemoveAds ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . RemoveAllAds ( ) ;
#endif
}
public override void SetUnitySDKVersion ( string sdkVersion )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . SetUnitySDKVersion ( sdkVersion ) ;
#endif
}
2023-09-12 09:23:21 +00:00
2022-08-30 02:21:29 +00:00
public override void RemoveNativeAd ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . RemoveNative ( ) ;
#endif
}
public override bool IsReadyNativeAd ( )
{
#if ! UNITY_EDITOR
return TGiOSAdManager . Instance . IsReadyNative ( ) ;
#else
return false ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
public override void ShowNativeAd ( RectTransform pRect , Camera pCam = null , string pAdPos = "" )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowNative ( pRect , pCam , pAdPos ) ;
#endif
}
2022-06-13 07:55:30 +00:00
2022-08-30 05:43:52 +00:00
#region Ads Show
2022-06-13 07:55:30 +00:00
/// <summary>
/// Show banner Ad
2022-08-30 02:21:29 +00:00
/// </summary>
/// <param name="_bannerAlign">bannerAlign</param>
public override void showBannerAd ( TKGBannerAlign _pos )
2022-06-13 07:55:30 +00:00
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowBanner ( ( int ) _pos ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Hide Banner Ad
/// </summary>
public override void hideBannerAd ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . HideBanner ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Show Interstitial Ad
/// </summary>
public override void showInterstitialAd ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowIntersititial ( "" , 0 ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Show Interstitial Ad
/// </summary>
/// <param name="_adPos"></param>
public override void showInterstitialAd ( string _adPos , IVADType _IvType = IVADType . IV1 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
TGiOSAdManager . Instance . ShowIntersititial ( _adPos , ( int ) _IvType ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Show Reward Ad
/// </summary>
public override void showRewardAd ( string _adPos , int _itemCount = - 1 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowRewardVideo ( _adPos ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <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 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowRewardVideo ( _adPos ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 05:43:52 +00:00
public override void SetShowSDKToast ( bool _useSDKToast )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowSDKToast ( _useSDKToast ) ;
#endif
}
2022-06-13 07:55:30 +00:00
/// <summary>
/// Show FullScreen Ad(is RV without reward callback)
/// </summary>
public override void showVideoAd ( string _adPos , int _itemCount = - 1 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . ShowRewardVideo ( _adPos ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Ads isready
2022-06-13 07:55:30 +00:00
/// <summary>
/// banner isReady
/// </summary>
/// <returns></returns>
public override bool isBannerAdReady ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
return TGiOSAdManager . Instance . IsReadyBanner ( ) ;
#else
2022-06-13 07:55:30 +00:00
return false ;
2022-08-30 02:21:29 +00:00
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Interstitial isReady
/// </summary>
/// <returns></returns>
public override bool isInterstitialAdReady ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
return TGiOSAdManager . Instance . IsReadyIntersititial ( ) ;
#else
2022-06-13 07:55:30 +00:00
return false ;
2022-08-30 02:21:29 +00:00
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Reward isReady
/// </summary>
/// <returns></returns>
public override bool isRewardAdReady ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
return TGiOSAdManager . Instance . IsReadyRewardVideo ( ) ;
#else
2022-06-13 07:55:30 +00:00
return false ;
2022-08-30 02:21:29 +00:00
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// FullScreen isReady
/// </summary>
/// <returns></returns>
public override bool isVideoAdReady ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
return TGiOSAdManager . Instance . IsReadyRewardVideo ( ) ;
#else
2022-06-13 07:55:30 +00:00
return false ;
2022-08-30 02:21:29 +00:00
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Set ads callback
2022-06-13 07:55:30 +00:00
/// <summary>
/// Set Banner Ad Callback
/// </summary>
/// <param name="_bannerCallback"></param>
public override void SetBannerAdCallback ( AndroidBannerADTKGAdCallback _bannerCallback )
{
}
/// <summary>
/// Set Interstital Ad Callback
/// </summary>
/// <param name="_interCallback"></param>
public override void setInterstitalAdCallback ( AndroidInterADTKGAdCallback _interCallback )
{
}
/// <summary>
/// Set reward Ad Callback
/// </summary>
/// <param name="_rewardCallback"></param>
public override void SetRewardAdCallback ( AndroidRewardADTKGAdCallback _rewardCallback )
{
}
/// <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 )
{
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region load ads
2022-06-13 07:55:30 +00:00
/// <summary>
/// load interstitial ad
/// (retry 3 times, per time interval 10s)
/// </summary>
public override void loadInterstitialAD ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LoadIntersititial ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// load reward ad
/// (retry 3 times, per time interval 10s)
/// </summary>
public override void loadRewardAD ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LoadRewardVideo ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// load video ad
/// (retry 3 times, per time interval 10s)
/// </summary>
public override void loadVideoAD ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LoadRewardVideo ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Log Event
2022-06-13 07:55:30 +00:00
/// <summary>
/// onEvent
/// </summary>
/// <param name="_eventName"></param>
/// <returns></returns>
public override void onEvent ( string _eventName )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_UMeng ( _eventName ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <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 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_UMeng ( _eventName , _key01 , _value01 ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <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 )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_UMeng ( _eventName , _key01 , _value01 , _key02 , _value02 ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// onEvent
/// </summary>
/// <param name="_eventName"></param>
/// <param name="_keyValues"></param>
public override void onEvent ( string _eventName , Dictionary < string , string > _keyValues )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_UMeng ( _eventName , _keyValues ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#region Level Event
2022-06-13 07:55:30 +00:00
/// <summary>
/// Level Start
/// </summary>
/// <param name="_levelId"></param>
public override void LevelStart ( string _levelId )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_GameStart ( _levelId ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// Level end
/// </summary>
2022-08-30 02:21:29 +00:00
/// <param name="_stageResult"></param>
public override void LevelEnd ( string _levelId , StageResult _stageResult )
2022-06-13 07:55:30 +00:00
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_GameEnd ( _levelId , ( int ) _stageResult ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Tracking Event
2022-06-13 07:55:30 +00:00
/// <summary>
/// Log Tracking Event
/// </summary>
/// <param name="_eventType"></param>
public override void LogTrackingEvent ( TrackingEventType _eventType )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . onEvent_Tenjin ( ( int ) _eventType ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Online Config
2022-06-13 07:55:30 +00:00
/// <summary>
/// get config - int
/// </summary>
/// <param name="_key"></param>
/// <returns></returns>
2022-08-30 02:21:29 +00:00
public override int GetConfigInt ( string _key , int _default )
2022-06-13 07:55:30 +00:00
{
2022-08-30 02:21:29 +00:00
return TGiOSAdManager . Instance . GetConfigInt ( _key , _default ) ;
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// get config - string
/// </summary>
/// <param name="_key"></param>
/// <returns></returns>
2022-08-30 02:21:29 +00:00
public override string GetConfigString ( string _key , string _default )
2022-06-13 07:55:30 +00:00
{
2022-08-30 02:21:29 +00:00
return TGiOSAdManager . Instance . GetConfigString ( _key , _default ) ;
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// get config - bool
/// </summary>
/// <param name="_key"></param>
/// <returns></returns>
2022-08-30 02:21:29 +00:00
public override bool GetConfigBool ( string _key , bool _default )
2022-06-13 07:55:30 +00:00
{
2022-08-30 02:21:29 +00:00
return TGiOSAdManager . Instance . GetConfigBool ( _key , _default ) ;
2022-06-13 07:55:30 +00:00
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Others ( Common )
2022-06-13 07:55:30 +00:00
/// <summary>
/// review
/// </summary>
public override void Review ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . Review ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// open Privacy
/// </summary>
public override void OpenPrivacyURL ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
TGiOSAdManager . Instance . OpenPrivacyURL ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// open agreement
/// </summary>
public override void OpenUserTermURL ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . OpenUserTermURL ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// open policy pop
/// </summary>
public override void OpenPolicyPop ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . OpenPolicyPop ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// More Games
/// </summary>
public override void OpenMoreGame ( )
{
2022-08-30 02:21:29 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . OpenMoreGame ( ) ;
#endif
2022-06-13 07:55:30 +00:00
}
2022-08-30 05:43:52 +00:00
// <summary>
/// share txt
/// </summary>
/// <param name="_shareTxt"></param>
public override void ShareTxt ( string _shareTxt )
{
TGiOSAdManager . Instance . share ( _shareTxt ) ;
}
2023-09-12 09:23:21 +00:00
/// <summary>
/// show picture cross
/// </summary>
public override bool showPictureCross ( )
{
#if UNITY_EDITOR
return false ;
#else
return TGiOSAdManager . Instance . showPictureCross ( ) ;
#endif
}
/// <summary>
/// remove picture cross
/// </summary>
public override void removePictureCross ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . removePictureCross ( ) ;
#endif
}
/// <summary>
/// show more game icon
/// </summary>
public override bool showMoreGameIcon ( )
{
#if UNITY_EDITOR
return false ;
#else
return TGiOSAdManager . Instance . showMoreGameIcon ( ) ;
#endif
}
/// <summary>
/// remove more game icon
/// </summary>
public override void removeMoreGameIcon ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . removeMoreGameIcon ( ) ;
#endif
}
2022-08-30 05:43:52 +00:00
public override void RegistAPNS ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . registAPNS ( ) ;
#endif
}
public override void RegistNotification ( string notiId , string body , string fireDate , int badge , string title , string subTitle )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . registNotification ( notiId , body , fireDate , badge , title , subTitle ) ;
#endif
}
2022-06-13 07:55:30 +00:00
2022-08-30 05:43:52 +00:00
public override void RemoveNotification ( string notiId )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . removeNotification ( notiId ) ;
#endif
}
public override void RemoveAllNotifications ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . removeAllNotifications ( ) ;
#endif
}
2022-08-30 02:21:29 +00:00
#endregion
2022-06-13 07:55:30 +00:00
2022-08-30 02:21:29 +00:00
#region Others ( Uncommon )
2022-06-13 07:55:30 +00:00
/// <summary>
/// shake(no repeat)
/// </summary>
/// <param name="_shakeTime"> shake time </param>
public override void shake ( int _shakeType , float _intensity = 1 )
{
2022-08-30 02:21:29 +00:00
TGiOSAdManager . Instance . shake ( _shakeType , _intensity ) ;
2022-06-13 07:55:30 +00:00
}
2023-09-12 09:23:21 +00:00
/// <summary>
/// get a iap product list for sdk config file
/// </summary>
public override Dictionary < string , string > GetIAPProductList ( )
{
return TGiOSAdManager . Instance . getIAPProductList ( ) ;
}
/// <summary>
/// set segment type to sdk
/// </summary>
/// <param name="type">segment type</param>
public override void SetSegment ( SegmentType type )
{
TGiOSAdManager . Instance . SetSegment ( type . ToString ( ) ) ;
}
public override bool IsDebugMode ( )
{
return TGiOSAdManager . Instance . isDebugMode ( ) ;
}
/// <summary>
/// get user name and user id card
/// </summary>
public override string GetUserNameAndUserIDCard ( )
{
return TGiOSAdManager . Instance . getUserNameAndUserIDCard ( ) ;
}
2022-06-13 07:55:30 +00:00
/// <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)
//{
//}
/// <summary>
/// cancel shake
/// </summary>
public override void 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 )
{
}
/// <summary>
/// Open ULR by Browser
/// </summary>
/// <param name="_url"></param>
public override void openUrlBrowser ( string _url )
{
}
/// <summary>
/// Open ULR By WEB POP
/// </summary>
/// <param name="_url"></param>
public override void openWebUrl ( string _url )
{
}
/// <summary>
/// show Toast
/// </summary>
/// <param name="_content"></param>
public override void toast ( string _content )
{
2022-08-30 05:43:52 +00:00
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . Toast ( _content ) ;
#endif
2022-06-13 07:55:30 +00:00
}
/// <summary>
/// push message
/// </summary>
public override void pushMsg ( )
{
}
2022-08-30 02:21:29 +00:00
#endregion
2023-09-12 09:23:21 +00:00
#region 数 据 中 台
public override void LogPurchasePrice ( string price , string currency )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LogPurchasePrice ( price , currency ) ;
#endif
}
public override void LogRobuxCashOut ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LogRobuxCashOut ( ) ;
#endif
}
public override void LogNoviceGuideFinish ( )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . LogNoviceGuideFinish ( ) ;
#endif
}
#endregion
2022-08-30 02:21:29 +00:00
#region common callback
public override void SetSDKCommonCallback ( AndroidTKGCommonCalllback _commonCallback )
{
}
public override void SetUserSourceCallback ( AndroidTKGUserSourceCalllback _userSourceCallback )
{
}
2022-08-30 05:43:52 +00:00
public override void SetUserSourceCallback ( AndroidTKGUserSourceCalllbackWithCampaignName _userSourceCallback )
{
}
2023-09-12 09:23:21 +00:00
public override void SetFunctionSwitchCalllback ( List < FunctionType > _functionKeys , AndroidFunctionSwitchCalllback _functionSwitchCalllback )
{
string temp = "" ;
if ( _functionKeys . Count ! = 0 )
{
for ( int index = 0 ; index < _functionKeys . Count ; index + + )
{
if ( index = = _functionKeys . Count - 1 )
{
temp + = _functionKeys [ index ] ;
}
else
{
temp = temp + _functionKeys [ index ] + "," ;
}
}
}
TGiOSAdManager . Instance . setFunctions ( temp ) ;
}
2022-08-30 05:43:52 +00:00
2023-09-12 09:23:21 +00:00
public override bool GuidGpComment ( )
{
return false ;
}
2022-08-30 02:21:29 +00:00
#endregion
2023-09-12 09:23:21 +00:00
#region 用 户 登 录
public override void Login ( LoginType loginType , Action < LoginStatus , LoginType , string , string , string , string , string , string > _loginResultCallback = null )
{
TKGSDKCallback . mLoginCallback = _loginResultCallback ;
TKGiOSLoginManager . Instance . Login ( loginType ) ;
}
public override void Logout ( Action _logoutCallback = null )
{
TKGSDKCallback . mLogoutCallback = _logoutCallback ;
TKGiOSLoginManager . Instance . Logout ( ) ;
}
public override List < LoginType > AvailableLoginChannelList ( )
{
return TKGiOSLoginManager . Instance . AvailableLoginChannelList ( ) ;
}
public override void DeleteAccount ( Action < DeleteStatus , string > _deleteAccountCallback = null )
{
TKGSDKCallback . mDeleteAccountCallback = _deleteAccountCallback ;
TKGiOSLoginManager . Instance . DeleteAccount ( ) ;
}
public override void BindAccount ( LoginType type , BindType isForce , string userId , Action < BindAccountStatus , LoginType , string , string , string , string , string , string , string [ ] > bindAccountCallback )
{
TKGSDKCallback . mBindAccountCallback = bindAccountCallback ;
TKGiOSLoginManager . Instance . BindAccount ( type , isForce , userId ) ;
}
#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>
/// <param name="_currency">Currency ex:USD</param>
/// <param name="_price">Price</param>
public override void LogIAPBtnShow ( string _productName , string _productID )
{
Dictionary < string , string > _keyValues = new Dictionary < string , string > ( ) ;
_keyValues . Add ( "IAP" , _productName ) ;
_keyValues . Add ( "ID" , _productID ) ;
//_keyValues.Add("Currency", _currency);
//_keyValues.Add("Price", _price);
onEvent ( "IAP_Button_Show" , _keyValues ) ;
}
/// <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>
/// <param name="_currency">Currency ex:USD</param>
/// <param name="_price">Price</param>
public override void LogIAPBtnClick ( string _productName , string _productID )
{
Dictionary < string , string > _keyValues = new Dictionary < string , string > ( ) ;
_keyValues . Add ( "IAP" , _productName ) ;
_keyValues . Add ( "ID" , _productID ) ;
//_keyValues.Add("Currency", _currency);
//_keyValues.Add("Price", _price);
onEvent ( "IAP_Button_Click" , _keyValues ) ;
}
/// <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="_currency">Currency ex:USD</param>
/// <param name="_price">Price</param>
public override void LogIAPFirstPurchase ( string _iap , string _id , string _paymentChannelOrderid , string _currency , string _price )
{
// native 层实现
//Dictionary<string, string> _keyValues = new Dictionary<string, string>();
//_keyValues.Add("IAP", _iap);
//_keyValues.Add("ID", _id);
//_keyValues.Add("Currency", _currency);
//_keyValues.Add("Price", _price);
//_keyValues.Add("order_id", _paymentChannelOrderid);
//onEvent("First_purchase", _keyValues);
}
/// <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>
public override void LogIAPSuccess ( string _iap , string _id , string _gameOrderid , string _paymentChannelOrderid , string _productToken , string _paymentMethod , string _currency , string _price )
{
//Dictionary<string, string> _keyValues = new Dictionary<string, string>();
//_keyValues.Add("IAP", _iap);
//_keyValues.Add("ID", _id);
//_keyValues.Add("Currency", _currency);
//_keyValues.Add("Price", _price);
//_keyValues.Add("order_id", _paymentChannelOrderid);
//onEvent("IAP_Success", _keyValues);
//Dictionary<string, string> _dataCenterDict = new Dictionary<string, string>();
//_dataCenterDict.Add("iap_name", _iap);
//_dataCenterDict.Add("product_id",_id);
//_dataCenterDict.Add("game_order_id",_gameOrderid);
//_dataCenterDict.Add("order_id",_paymentChannelOrderid);
//_dataCenterDict.Add("purchase_token", _productToken);
//_dataCenterDict.Add("payment_method", _paymentMethod);
//_dataCenterDict.Add("currency", _currency);
//_dataCenterDict.Add("price", _price);
//onEvent("IAP_DataCenter",_dataCenterDict);
}
public override void AutoLogin ( Action < LoginStatus , LoginType , string , string , string , string , string , string > loginResultCallback )
{
TKGSDKCallback . mLoginCallback = loginResultCallback ;
TKGiOSLoginManager . Instance . AutoLogin ( ) ;
}
public override LoginType GetAccountType ( )
{
var userType = PlayerPrefs . GetInt ( "user_type" ) ;
return ( LoginType ) Enum . ToObject ( typeof ( LoginType ) , userType ) ;
}
public override void SaveCloudArchiving ( string content , Action < int , string > callback )
{
}
public override void DetailCloudArchiving ( Action < int , string > callback )
{
}
public override bool IsCanAutoLogin ( )
{
return TKGiOSLoginManager . Instance . IsCanAutoLogin ( ) ;
}
#endregion
#region serve for wz
/// <summary>
/// Set userid and third account
/// </summary>
/// <param name="_userID"> userID (Unique user id)</param>
/// <param name="_thirdAccount">third account </param>
/// <param name="_thirdAccountType"> third account type </param>
public override void SetUserIDAndThirdAccount ( string _userID , string _thirdAccount , ThirdAccountType _thirdAccountType )
{
Debug . Log ( "【TKGNativeInterfaceiOS】 SetUserIDAndThirdAccount _userID : " + _userID + " , _thirdAccount : " + _thirdAccount + " , _thirdAccountType : " + _thirdAccountType ) ;
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . setUserIDAndThirdAccount ( _userID , _thirdAccount , _thirdAccountType ) ;
#endif
}
#endregion
#region client iap pay result
/// <summary>
/// Client IAP Success
/// </summary>
public override void ClientIAPSuccess ( string _productName , string _productID , string _purchaseOrderID , string _purchaseToken , string _currency , string _price , string _gameExtra )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . IAP_ClientIAPSuccess ( _productName , _productID , _purchaseOrderID , _purchaseToken , _currency , _price , _gameExtra ) ;
#endif
}
/// <summary>
/// Client IAP Failed
/// </summary>
public override void ClientIAPFailed ( string _productName , string _productID , string _purchaseOrderID , string _purchaseToken , string _currency , string _price , string _gameExtra , IAPClientFailReasonType _failType )
{
#if ! UNITY_EDITOR
TGiOSAdManager . Instance . IAP_ClientIAPFailed ( _productName , _productID , _purchaseOrderID , _purchaseToken , _currency , _price , _gameExtra , _failType ) ;
#endif
}
#endregion
2022-06-13 07:55:30 +00:00
}
}
#endif