升级SDK
This commit is contained in:
parent
cf098fd14e
commit
5f26bd4acb
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 705890f228a4c472e88cec9b9fe9dabd
|
||||
guid: b9d295f1d6b40474b832740c53dc0162
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b59d193ebd0d3497eb79fb34870d40f6
|
||||
guid: b1e0c8870faab4b1e81eb56a2625ca49
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ea418034ba8f84791a72f3b44114f3bd
|
||||
guid: 5da1691e284094478a2e118f3b0a75f3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 151ece50904194ed29cf527cd0899b27
|
||||
guid: cf3e87ee224034a7ca32d0029936d6c9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f27ea099fefb4431b9bd570f8abb4c83
|
||||
guid: ad451212a49674981ba4f6b25add243e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6db33fd59470c4a62aed196ae5871f6c
|
||||
guid: aa1bc22b5c00243859a237218c12aca1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b15dc3c41ae014b5892f4e725ffc0f49
|
||||
guid: 666f447dd2b6443b39554966728d7c78
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d7e9a64dfa9d14a3a8817630fc76c707
|
||||
guid: 9840d4c4318154ad0aedd3db85a160c5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e22ce4f57bd504c5fa0cb4f85abe69a6
|
||||
guid: 782c7de76a22d40dfb37a8437a2ea3a3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d840e92ebdf14b02af0fc0a01890707
|
||||
guid: 1294a7658c772475faf0ec2c9f3e0c75
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cafa1e10fdd7441dea541ccf44f10a5b
|
||||
guid: a61e112658de04b20b31be593643b5c9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 84ea0ccc4756c4f3ca0d2fb0b7722b78
|
||||
guid: 029e23b4cda80416d9ed94ad22322a25
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ed9aea37cca464316abef46d8db59742
|
||||
guid: 028f9d614ff9645049c5442f49e415a0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 34590973c69fd434ba90435dad3089bf
|
||||
guid: f331eb275e4a044118d322d3a084c5dc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 07348e3b096874b158b5864d107718c5
|
||||
guid: dcad451e8aec74340b22c7a5ad1ccbd1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 112bf15fd187447cb873409971032f7f
|
||||
guid: 9029b80a1d92f4b059f54c3a82301106
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3f56ec6c20c5d46aba5faa92d62ab64a
|
||||
guid: b29d5e4271ebd461ebf3bca61b62460a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2337850b7f3b34a4ca519ae522a11256
|
||||
guid: 2284204ea11fb4b92bce0a0b687322c5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
|
@ -67,15 +67,8 @@ namespace Touka
|
|||
|
||||
ToukaUtils.InitTenjinFirst();
|
||||
|
||||
if (GetConfigBool(ToukaInnerParamKey.IsShowAuthView.ToString()))
|
||||
{
|
||||
TGiOSAdManager.Instance.onAntiSuccessHander += AntiSucceed;
|
||||
TGiOSAdManager.Instance.ShowAntiView();
|
||||
}
|
||||
else
|
||||
{
|
||||
mInitCallback?.Invoke();
|
||||
}
|
||||
TGiOSAdManager.Instance.onAntiSuccessHander += AntiSucceed;
|
||||
TGiOSAdManager.Instance.ShowAntiView();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -112,7 +105,7 @@ namespace Touka
|
|||
/// <param name="_pos">1:top,2:bottom</param>
|
||||
public void ShowBanner(int _pos)
|
||||
{
|
||||
|
||||
ToukaSDKManager.Instance.ShowOrHideBanner(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -120,7 +113,7 @@ namespace Touka
|
|||
/// </summary>
|
||||
public void HideBanner()
|
||||
{
|
||||
|
||||
ToukaSDKManager.Instance.ShowOrHideBanner(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -30,13 +30,16 @@ public static partial class StaticStringsKey {
|
|||
public const string MAX_AppLovinSdkKey = "QVt-ZBOR44Frm2Ub8gEfbPo-K8SeKHvyzoq-TJ3op08cFx29THV9DviWinxrQBxNePGKU14gHOkClTrNOi_1a9"; // max key- (同一个账号key相同)
|
||||
public const string MAX_IV = "a1932f8e658086d1"; // max 插屏id
|
||||
public const string MAX_RV = "5c7cf996479ff5f2"; // max 激励视频id
|
||||
public const string MAX_NATIVE_TEMPLATE = "";
|
||||
public const string MAX_MATIVE_MANUAL = "";
|
||||
public const string MAX_BANNER = "";
|
||||
|
||||
// Ads Switch
|
||||
public const bool BannerSwitch = false; // banner Switch
|
||||
public const bool InterSwitch = true; // IV Switch
|
||||
public const bool RewardSwitch = true; // RV Switch
|
||||
public const bool NativeSwitch = false; // native Switch
|
||||
public const bool SplashSwitch = true; // Splash Switch
|
||||
public const bool SplashSwitch = false; // Splash Switch
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -56,23 +59,24 @@ public static partial class StaticStringsKey {
|
|||
// touka sdk
|
||||
public const string TOUKA_SDK_APPKEY = TOPON_APPKEY;
|
||||
|
||||
public const string TOUKA_SDK_BANNERID = TOPON_NativeBannerUnitId;
|
||||
public const string TOUKA_SDK_SPLASHID = TOPON_NativeOpenscreenId;
|
||||
|
||||
|
||||
#if IOS_CN
|
||||
#if PANGLE
|
||||
#if PANGLE
|
||||
public const string TOUKA_SDK_APPID = PANGLE_APPID;
|
||||
public const string TOUKA_SDK_INTERID = PANGLE_IntersUnitId;
|
||||
public const string TOUKA_SDK_REWARDID = PANGLE_RewardVideoUnitId;
|
||||
public const string TOUKA_SDK_NATIVEID = PANGLE_NativeUnitId;
|
||||
public const string TOUKA_SDK_ORIGINSPLASHID = PANGLE_OriginOpenScreenId;
|
||||
#else
|
||||
public const string TOUKA_SDK_BANNERID = "";
|
||||
#else
|
||||
public const string TOUKA_SDK_APPID = TOPON_APPID;
|
||||
public const string TOUKA_SDK_INTERID = TOPON_IntersUnitId;
|
||||
public const string TOUKA_SDK_REWARDID = TOPON_RewardVideoUnitId;
|
||||
public const string TOUKA_SDK_NATIVEID = TOPON_NativeUnitId;
|
||||
public const string TOUKA_SDK_ORIGINSPLASHID = TOPON_OriginOpenScreenId;
|
||||
public const string TOUKA_SDK_BANNERID = TOPON_NativeBannerUnitId;
|
||||
#endif
|
||||
#else
|
||||
public const string TOUKA_SDK_APPID = TOPON_APPID;
|
||||
|
@ -80,6 +84,7 @@ public static partial class StaticStringsKey {
|
|||
public const string TOUKA_SDK_REWARDID = MAX_RV;
|
||||
public const string TOUKA_SDK_NATIVEID = TOPON_NativeUnitId;
|
||||
public const string TOUKA_SDK_ORIGINSPLASHID = TOPON_OriginOpenScreenId;
|
||||
public const string TOUKA_SDK_BANNERID = MAX_BANNER;
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
|
Binary file not shown.
|
@ -28,12 +28,31 @@ public partial class ToukaAdsBuildPostProcessor
|
|||
plist.root.SetString("GADApplicationIdentifier", StaticStringsKey.GADValue);
|
||||
plist.root.SetBoolean("GADIsAdManagerApp", true);
|
||||
|
||||
|
||||
#if IOS_CN
|
||||
plist.root.SetString("AppId", StaticStringsKey.TOUKA_SDK_APPID);
|
||||
plist.root.SetString("AppKey", StaticStringsKey.TOUKA_SDK_APPKEY);
|
||||
plist.root.SetString("splashPlacement", StaticStringsKey.TOUKA_SDK_ORIGINSPLASHID);
|
||||
plist.root.SetString("nativeSplashPlacement", StaticStringsKey.TOUKA_SDK_SPLASHID);
|
||||
plist.root.SetString("splashStatus", StaticStringsKey.SplashSwitch ? "1" : "0");
|
||||
#else
|
||||
// 自渲染广告广告位ID
|
||||
plist.root.SetString("nativeManualPlacementId", StaticStringsKey.MAX_MATIVE_MANUAL);
|
||||
|
||||
// 模板广告广告位ID
|
||||
plist.root.SetString("nativeTemplatesPlacementId", StaticStringsKey.MAX_NATIVE_TEMPLATE);
|
||||
|
||||
// 0模板渲染 1自定义渲染
|
||||
plist.root.SetString("nativeType", "1");
|
||||
|
||||
// native 广告开关,默认开启 1: 开启,0: 关闭
|
||||
plist.root.SetString("nativeStatus", "1");
|
||||
|
||||
// 1,blue; 2,green; 3,orange;4,purple;默认橘色
|
||||
plist.root.SetString("nativeTemplatesType","3");
|
||||
|
||||
// banner 的开关
|
||||
plist.root.SetString("bannerStatus", "1");
|
||||
#endif
|
||||
|
||||
plist.root.SetString("AppLovinSdkKey", StaticStringsKey.MAX_AppLovinSdkKey);
|
||||
|
|
|
@ -31,11 +31,19 @@ namespace Touka
|
|||
s_instance = this;
|
||||
|
||||
}
|
||||
public void ShowNativeAd()
|
||||
|
||||
public void RemoveNative()
|
||||
{
|
||||
ToukaAdManager.Instance.HideNative(false);
|
||||
}
|
||||
|
||||
public void ShowNativeAd(string adpos)
|
||||
{
|
||||
Debug.Log("yangwu " + GetX() + "y" + GetY() + "width" + GetWidth() + "hei" + GetWidth());
|
||||
if (ToukaAdManager.Instance.IsReadyNative)
|
||||
{
|
||||
ToukaAdManager.Instance.ShowNative(GetX(), GetY(), GetWidth(), GetHeight());
|
||||
|
||||
ToukaAdManager.Instance.ShowNative(GetX(), GetY(), GetWidth(), GetHeight(),adpos);
|
||||
}
|
||||
}
|
||||
//由于loadnative 函数有个问题,比如多个位置多个不同尺寸的native。目前只能处理一个尺寸,所以设置了firstFlg,位置宽高得到一次即可。
|
||||
|
|
|
@ -7,7 +7,8 @@ using System;
|
|||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class TGUniversalFunc : MonoBehaviour {
|
||||
public class TGUniversalFunc : MonoBehaviour
|
||||
{
|
||||
|
||||
//banner
|
||||
public static Action onSetBannerListener_onAdLoaded;
|
||||
|
@ -19,7 +20,7 @@ public class TGUniversalFunc : MonoBehaviour {
|
|||
public static Action onSetBannerListener_onClick;
|
||||
|
||||
public static Action onSetBannerListener_onAdClosed;
|
||||
|
||||
|
||||
//interstitial
|
||||
public static Action onSetInterstitialListener_onAdLoaded;
|
||||
|
||||
|
@ -60,7 +61,7 @@ public class TGUniversalFunc : MonoBehaviour {
|
|||
public static Action<string> onSetRewardListener_onRewardedVideoAdClosed;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoClickAd;
|
||||
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoAdEnd;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoAdPlayFail;
|
||||
|
@ -83,4 +84,7 @@ public class TGUniversalFunc : MonoBehaviour {
|
|||
public static Action onSetNativeBannerListener_onAdLoaded;
|
||||
|
||||
public static Action onSetNativeBannerListener_onAdLoadFail;
|
||||
|
||||
// 用户来源
|
||||
public static Action<string> onSetUserSourceListener_onSuccess;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
|
||||
private static TGiOSAdManager s_instance;
|
||||
public Action onAntiSuccessHander;
|
||||
private System.Action<bool> m_userSourceCallback;
|
||||
|
||||
public static TGiOSAdManager Instance
|
||||
{
|
||||
get
|
||||
|
@ -63,8 +65,14 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
private static extern void loadNativeWithUnitId(string unitId, float width, float height);
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool isReadyNativeWithUnitId(string unitId);
|
||||
#if IOS_CN
|
||||
[DllImport("__Internal")]
|
||||
private static extern void layoutNativeWithFrame(float x, float y, float width, float height);
|
||||
#else
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void layoutNativeWithFrame(float x, float y, float width, float height,string adpos);
|
||||
#endif
|
||||
[DllImport("__Internal")]
|
||||
private static extern void showNativeWithUnitId(string unitId);
|
||||
[DllImport("__Internal")]
|
||||
|
@ -86,10 +94,33 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
[DllImport("__Internal")]
|
||||
private static extern void newUserPassLevel();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !IOS_CN
|
||||
[DllImport("__Internal")]
|
||||
private static extern void getUserSource();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
public void GetUserSource(System.Action<bool> _callback)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK && !IOS_CN
|
||||
m_userSourceCallback = _callback;
|
||||
getUserSource();
|
||||
#endif
|
||||
|
||||
}
|
||||
/*
|
||||
* 0 是自然用户
|
||||
* 1 是非自然用户
|
||||
*/
|
||||
public void onUserSource(string obj)
|
||||
{
|
||||
bool isTrue = obj == "0";
|
||||
if (m_userSourceCallback != null) m_userSourceCallback(isTrue);
|
||||
|
||||
}
|
||||
|
||||
//新用户打点上报
|
||||
public void NewUserPassLevel()
|
||||
{
|
||||
|
@ -129,12 +160,15 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
|
||||
public void InitSDK(string appID, string appKey)
|
||||
{
|
||||
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
TGUniversalFunc.onSetUserSourceListener_onSuccess += onUserSource;
|
||||
initSDK(appID, appKey);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#region native banner
|
||||
#region native banner
|
||||
public void LoadNativeBannerWithUnitId(string unitId)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
|
@ -178,10 +212,10 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
removeNativeBanner();
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region banner
|
||||
#region banner
|
||||
public void LoadBannerWithUnitId(string unitId)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
|
@ -225,9 +259,9 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
removeNativeBanner();
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region interstitial
|
||||
#region interstitial
|
||||
public void Loadinterstitial(string unitId)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
|
@ -250,31 +284,32 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
showInterstitialWithUnitId(unitId);
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region native
|
||||
#region native
|
||||
public void LoadNative(string unitId, float width, float height)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
loadNativeWithUnitId(unitId, width, height);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public bool IsReadNative(string unitId)
|
||||
public bool IsReadNative(string unitId)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
return isReadyNativeWithUnitId(unitId);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public void ShowNative(float x, float y, float width, float height, string unitId)
|
||||
public void ShowNative(float x, float y, float width, float height, string unitId, string adpos)
|
||||
{
|
||||
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
layoutNativeWithFrame(x, y, width, height);
|
||||
layoutNativeWithFrame(x, y, width, height,adpos);
|
||||
showNativeWithUnitId(unitId);
|
||||
#endif
|
||||
}
|
||||
|
@ -284,11 +319,10 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
removeNative();
|
||||
#endif
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region rewardVideo
|
||||
#region rewardVideo
|
||||
public void LoadVideo(string unitId)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
|
@ -311,26 +345,31 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
showRewardVideoWithUnitId(unitId);
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region
|
||||
#region
|
||||
public void UpdateConversionValue(string value)
|
||||
{
|
||||
#if UNITY_IPHONE && !UNITY_EDITOR && !NO_SDK
|
||||
updateConversionValue(value);
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region
|
||||
#region
|
||||
|
||||
public void AntiSuccessCallback()
|
||||
{
|
||||
onAntiSuccessHander?.Invoke();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region interstitialCallback
|
||||
public void TGGetUserSource(string obj)
|
||||
{
|
||||
TGUniversalFunc.onSetUserSourceListener_onSuccess?.Invoke(obj);
|
||||
}
|
||||
|
||||
#region interstitialCallback
|
||||
public void TGInterstitialAdLoad(string obj)
|
||||
{
|
||||
TGUniversalFunc.onSetInterstitialListener_onAdLoaded?.Invoke();
|
||||
|
@ -377,9 +416,9 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
TGUniversalFunc.onSetInterstitialListener_onStartPlayVideo?.Invoke();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region videoCallback
|
||||
#region videoCallback
|
||||
public void TGVideoAdLoaded(string obj)
|
||||
{
|
||||
TGUniversalFunc.onSetRewardListener_onRewardedVideoAdLoaded?.Invoke();
|
||||
|
@ -420,10 +459,10 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
TGUniversalFunc.onSetRewardListener_onRewarded?.Invoke();
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region bannerCallback
|
||||
#region bannerCallback
|
||||
public void TGBannerAdLoad(string obj)
|
||||
{
|
||||
TGUniversalFunc.onSetBannerListener_onAdLoaded?.Invoke();
|
||||
|
@ -448,9 +487,9 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
{
|
||||
TGUniversalFunc.onSetBannerListener_onAdClosed?.Invoke();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region nativeCallback
|
||||
#region nativeCallback
|
||||
public void TGNativeAdLoadFail(string obj)
|
||||
{
|
||||
TGUniversalFunc.onSetNativeListener_onAdFailedToLoad?.Invoke();
|
||||
|
@ -470,9 +509,9 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
{
|
||||
TGUniversalFunc.onSetNativeListener_onClick?.Invoke();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region native banner
|
||||
#region native banner
|
||||
|
||||
public void TGNativeBannerAdLoad(string obj)
|
||||
{
|
||||
|
@ -485,7 +524,7 @@ public class TGiOSAdManager : MonoBehaviour
|
|||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -66,8 +66,8 @@ namespace Touka
|
|||
int hasLogged = ToukaUtils.GetPlayerPrefsIntByKey(hasUploadEvent);
|
||||
if (hasLogged != 10000)
|
||||
{
|
||||
string eventName = string.Format("AUTO_{0}_{1}_{2}", TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IVSwitch_OnlineParam.ToString(), 0), TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IV_Counts_OnlineParam.ToString(), 1), TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IV_MinTime_OnlineParam.ToString(), 30));
|
||||
ToukaSDKManager.Instance.LogEventByUmeng(eventName);
|
||||
string eventValue = string.Format("{0}_{1}_{2}", TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IVSwitch_OnlineParam.ToString(), 0), TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IV_Counts_OnlineParam.ToString(), 1), TKGSDKManager.Instance.GetConfigInt(ToukaInnerParamKey.Auto_Show_IV_MinTime_OnlineParam.ToString(), 30));
|
||||
ToukaSDKManager.Instance.LogEventByUmeng("Autoiv", StaticStringsEvent.Event_Type_TKInner_ad_position, eventValue);
|
||||
ToukaUtils.SavePlayerPrefsIntByKeyValue(hasUploadEvent, 10000);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ namespace Touka
|
|||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
/// <returns></returns>
|
||||
public bool ShowNative(float x, float y, float width, float height)
|
||||
public bool ShowNative(float x, float y, float width, float height,string adpos)
|
||||
{
|
||||
Debug.Log("ShowNative()");
|
||||
#if UNITY_EDITOR
|
||||
|
@ -419,7 +419,7 @@ namespace Touka
|
|||
if (IsReadyNative)
|
||||
{
|
||||
Debug.Log("Touka: ShowNative, x : " + x + " , y : " + y + " , width : " + width + " , height : " + height);
|
||||
toukaAds.ShowNative(x, y, width, height);
|
||||
toukaAds.ShowNative(x, y, width, height,adpos);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -576,7 +576,6 @@ namespace Touka
|
|||
/// </summary>
|
||||
public void LoadNative()
|
||||
{
|
||||
#if IOS_CN
|
||||
if (Application.internetReachability != NetworkReachability.NotReachable)
|
||||
{
|
||||
|
||||
|
@ -601,7 +600,6 @@ namespace Touka
|
|||
{
|
||||
Debug.Log("Touka: Don't load native for NetworkReachability.NotReachable");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -11,7 +11,7 @@ public interface IToukaAdInterface {
|
|||
void ShowVideo (System.Action<ToukaVideoStatus> _callback);
|
||||
void ShowIntersitial (System.Action<ToukaIntersitialStatus> _callback);
|
||||
void ShowBanner ();
|
||||
void ShowNative(float x, float y, float width, float height);
|
||||
void ShowNative(float x, float y, float width, float height,string adpos);
|
||||
|
||||
|
||||
void RemoveBanner(bool _clean);
|
||||
|
|
|
@ -204,10 +204,10 @@ namespace Touka
|
|||
/// <param name="y"> native y坐标 </param>
|
||||
/// <param name="width"> native width </param>
|
||||
/// <param name="height"> native height </param>
|
||||
public void ShowNative(float x, float y, float width, float height)
|
||||
public void ShowNative(float x, float y, float width, float height,string adpos)
|
||||
{
|
||||
#if UNITY_IOS && !NO_SDK
|
||||
TGiOSAdManager.Instance.ShowNative(x, y, width, height, StaticStringsKey.TOUKA_SDK_NATIVEID);
|
||||
TGiOSAdManager.Instance.ShowNative(x, y, width, height, StaticStringsKey.TOUKA_SDK_NATIVEID,adpos);
|
||||
#elif UNITY_ANDROID
|
||||
TGAndroidAdManager.Instance.ShowNative(x, y, width, height, StaticStringsKey.TOUKA_SDK_NATIVEID);
|
||||
#endif
|
||||
|
|
|
@ -146,9 +146,9 @@ namespace Touka
|
|||
}
|
||||
|
||||
|
||||
public void ShowNative()
|
||||
public void ShowNative(string adpos)
|
||||
{
|
||||
NativeAd.Instance.ShowNativeAd();
|
||||
NativeAd.Instance.ShowNativeAd(adpos);
|
||||
}
|
||||
|
||||
public void RemoveNative()
|
||||
|
|
|
@ -6,6 +6,10 @@ using UnityEngine;
|
|||
|
||||
using GameAnalyticsSDK.Wrapper;
|
||||
using Touka.GameLogic;
|
||||
using System;
|
||||
#if UNITY_IOS
|
||||
using UnityEngine.iOS;
|
||||
#endif
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
|
@ -43,7 +47,7 @@ namespace Touka
|
|||
ToukaUtilsInner.Instance.SaveFirstLoginTime(); // 记录首次登录游戏时间
|
||||
}
|
||||
|
||||
#region Inits
|
||||
#region Inits
|
||||
|
||||
/// <summary>
|
||||
/// 初始化Umeng
|
||||
|
@ -129,14 +133,33 @@ namespace Touka
|
|||
{
|
||||
#if !ANDROID_TW
|
||||
Debug.Log("[ToukaAnalyticsManager] init tenjin inner");
|
||||
BaseTenjin instance = Tenjin.getInstance(StaticStringsKey.TENJIN_KEY);
|
||||
|
||||
// Sends install/open event to Tenjin
|
||||
BaseTenjin instance = Tenjin.getInstance(StaticStringsKey.TENJIN_KEY);
|
||||
#if UNITY_IOS
|
||||
if (new Version(Device.systemVersion).CompareTo(new Version("14.0")) >= 0)
|
||||
{
|
||||
// Tenjin wrapper for requestTrackingAuthorization
|
||||
instance.RequestTrackingAuthorizationWithCompletionHandler((status) => {
|
||||
Debug.Log("===> App Tracking Transparency Authorization Status: " + status);
|
||||
|
||||
// Sends install/open event to Tenjin
|
||||
instance.Connect();
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
instance.Connect();
|
||||
}
|
||||
#else
|
||||
instance.Connect();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ public static partial class StaticStringsEvent {
|
|||
public const string Event_Tenjin_TKInner_NewUserAdsCount = "new_user_ads_count"; // 新用户观看X次广告
|
||||
|
||||
// umeng打点
|
||||
public const string Event_Sort_TKInner_iv_ad_show = "iv_ad_show"; // 插屏展示
|
||||
public const string Event_Sort_TKInner_iv_ad_show = "Iv_Show"; // 插屏展示
|
||||
public const string Event_Sort_TKInner_iv_ad_show_failed = "iv_ad_show_failed"; // 插屏展示失败
|
||||
public const string Event_Sort_TKInner_rv_ad_show = "rv_ad_show"; // 激励视频展示
|
||||
public const string Event_Sort_TKInner_rv_ad_show = "Rv_Show"; // 激励视频展示
|
||||
public const string Event_Sort_TKInner_rv_ad_show_fail = "rv_ad_show_fail"; // 激励视频展示失败
|
||||
public const string Event_Type_TKInner_ad_position = "ad_position"; // 广告点位
|
||||
public const string Event_Type_TKInner_ad_position = "AD"; // 广告点位
|
||||
public const string Event_Sort_TKInner_ad_button_show = "ad_button_show"; // 广告按钮展示
|
||||
public const string Event_Sort_TKInner_ad_button_click = "ad_button_click"; // 广告按钮点击
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Touka
|
|||
private void StageTimeEvent(string _levelId)
|
||||
{
|
||||
int lastSeconds = GetStageDeltaTime();
|
||||
ToukaSDKManager.Instance.LogEventByUmeng(StaticStringsEvent.Event_Sort_stage_time, StaticStringsEvent.Event_Sort_stage_level, _levelId.ToString(), StaticStringsEvent.Event_Sort_time_long, lastSeconds.ToString());
|
||||
ToukaSDKManager.Instance.LogEventByUmeng(StaticStringsEvent.Event_Sort_stage_time, StaticStringsEvent.Event_Sort_stage_level, _levelId.ToString() + "_" + lastSeconds.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
public static partial class StaticStringsEvent
|
||||
{
|
||||
// stage
|
||||
public const string Event_Sort_stage_start = "stage_start";
|
||||
public const string Event_Sort_stage_time = "stage_time";
|
||||
public const string Event_Sort_stage_failure = "stage_failure";
|
||||
public const string Event_Sort_stage_success = "stage_success";
|
||||
public const string Event_Sort_stage_start = "Level_Start";
|
||||
public const string Event_Sort_stage_time = "Level_Time";
|
||||
public const string Event_Sort_stage_failure = "Level_Fail";
|
||||
public const string Event_Sort_stage_success = "Level_Success";
|
||||
|
||||
public const string Event_Sort_stage_level = "stage_level";
|
||||
public const string Event_Sort_stage_level = "Level";
|
||||
public const string Event_Sort_time_long = "time_long";
|
||||
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ PlayerSettings:
|
|||
iPhone: com.hotpotgames.mergemilitary.global
|
||||
buildNumber:
|
||||
Standalone: 1
|
||||
iPhone: 2
|
||||
iPhone: 3
|
||||
AndroidBundleVersionCode: 1
|
||||
AndroidMinSdkVersion: 21
|
||||
AndroidTargetSdkVersion: 30
|
||||
|
|
Loading…
Reference in New Issue