Merge branch 'main' of http://v4.9ms.co:7777/yufeng/SDK_UnityMoney
# Conflicts: # Assets/Script/SDKManager/AdjustManager/AdjustTrackEvent.cs
This commit is contained in:
commit
7119ae470f
|
|
@ -114,7 +114,7 @@ namespace WZ
|
||||||
for (int i = 0; i < _configs.Length; i++)
|
for (int i = 0; i < _configs.Length; i++)
|
||||||
{
|
{
|
||||||
string valueTemp = _configs[i].Value.ToString();
|
string valueTemp = _configs[i].Value.ToString();
|
||||||
LoggerUtils.Debug("[FileParse] ParseConfigsInner key" + _configs[i].Key + "value:" + valueTemp);
|
//LoggerUtils.Debug("[FileParse] ParseConfigsInner key" + _configs[i].Key + "value:" + valueTemp);
|
||||||
|
|
||||||
if (_configs[i].Key.ToLower() == KEY_Admob_CollapsibleBannerId.ToLower())
|
if (_configs[i].Key.ToLower() == KEY_Admob_CollapsibleBannerId.ToLower())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: bd74719ba6cd94424a20539116ebabff
|
guid: bd74719ba6cd94424a20539116ebabff
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1db01a1175e3f451bbf15da2925e759a
|
guid: 1db01a1175e3f451bbf15da2925e759a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8c783da4d1e92421e875e007d834b039
|
guid: 8c783da4d1e92421e875e007d834b039
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 34aa20abb977944f29d68bb385e84b01
|
guid: 34aa20abb977944f29d68bb385e84b01
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,21 @@ using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
public class AdjustManager : NormalSingleton<AdjustManager>
|
public class AdjustManager : D_MonoSingleton<AdjustManager>
|
||||||
{
|
{
|
||||||
private string appToken = "cap3ypurzegw"; // 替换为你的实际App Token
|
|
||||||
private AdjustEnvironment environment = AdjustEnvironment.Sandbox; // 测试用Sandbox,发布用Production
|
private AdjustEnvironment environment = AdjustEnvironment.Sandbox; // 测试用Sandbox,发布用Production
|
||||||
|
|
||||||
private long startTime = 0;
|
private long startTime = 0;
|
||||||
|
|
||||||
|
private string Adid;
|
||||||
|
private string Gdid;
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
//开始计时
|
//开始计时
|
||||||
startTime = TimeUtils.GetLocalTimestamp();
|
startTime = TimeUtils.GetLocalTimestamp();
|
||||||
|
|
||||||
AdjustConfig config = new AdjustConfig(appToken, environment);
|
AdjustConfig config = new AdjustConfig(StaticValue.AdjustToken, environment);
|
||||||
|
|
||||||
// 设置归因变更回调函数
|
// 设置归因变更回调函数
|
||||||
config.AttributionChangedDelegate = AttributionChangedDelegate;
|
config.AttributionChangedDelegate = AttributionChangedDelegate;
|
||||||
|
|
@ -28,6 +30,10 @@ public class AdjustManager : NormalSingleton<AdjustManager>
|
||||||
// 初始化Adjust SDK
|
// 初始化Adjust SDK
|
||||||
Adjust.InitSdk(config);
|
Adjust.InitSdk(config);
|
||||||
|
|
||||||
|
//id
|
||||||
|
LoadAdid();
|
||||||
|
LoadGaid();
|
||||||
|
|
||||||
//计时3分钟
|
//计时3分钟
|
||||||
AppSDKManager.Instance.Coroutine(AdjustNetwork.Instance.SetOrganic3Min());
|
AppSDKManager.Instance.Coroutine(AdjustNetwork.Instance.SetOrganic3Min());
|
||||||
|
|
||||||
|
|
@ -50,5 +56,28 @@ public class AdjustManager : NormalSingleton<AdjustManager>
|
||||||
return startTime;
|
return startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadGaid()
|
||||||
|
{
|
||||||
|
Adjust.GetGoogleAdId(googleAdId => {
|
||||||
|
Gdid = googleAdId;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetGdid()
|
||||||
|
{
|
||||||
|
return Gdid;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadAdid()
|
||||||
|
{
|
||||||
|
Adjust.GetAdid(adid =>
|
||||||
|
{
|
||||||
|
Adid = adid;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetAdid()
|
||||||
|
{
|
||||||
|
return Adid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
public class AdjustNetwork : NormalSingleton<AdjustNetwork>
|
public class AdjustNetwork : D_MonoSingleton<AdjustNetwork>
|
||||||
{
|
{
|
||||||
private const string KEY_USER_NETWORK = "KEY_USER_NETWORK";
|
private const string KEY_USER_NETWORK = "KEY_USER_NETWORK";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using UnityEngine;
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public class AdmobAdsManager : NormalSingleton<AdmobAdsManager>, IAdService
|
public class AdmobAdsManager : D_MonoSingleton<AdmobAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
public string ClientName => "Admob";
|
public string ClientName => "Admob";
|
||||||
public PlatformType Platfrom => PlatformType.Admob;
|
public PlatformType Platfrom => PlatformType.Admob;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7b60d6c8a08c64629a3ae1a20bb7acbc
|
guid: 7b60d6c8a08c64629a3ae1a20bb7acbc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 64f1fb952d2214082b5d90c7c1b114f5
|
guid: 64f1fb952d2214082b5d90c7c1b114f5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 836d77072fa604c0480097316bb1aabe
|
guid: 836d77072fa604c0480097316bb1aabe
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5421cfa6befcb4e48a4361180aa3c8ff
|
guid: 5421cfa6befcb4e48a4361180aa3c8ff
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8a66ed9c6ea4e42e5a057855d6888b3c
|
guid: 8a66ed9c6ea4e42e5a057855d6888b3c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 137bc68f35e5e4e9383ffd94f745c1bd
|
guid: 137bc68f35e5e4e9383ffd94f745c1bd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3a7b10d4700bc4808b22cd6be81314e8
|
guid: 3a7b10d4700bc4808b22cd6be81314e8
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
public class AdsSDKManager : D_MonoSingleton<AdsSDKManager>
|
||||||
{
|
{
|
||||||
private List<IAdService> _adNetworks = new List<IAdService>();
|
private List<IAdService> _adNetworks = new List<IAdService>();
|
||||||
// 是否有激励视频或者插屏广告在展示
|
// 是否有激励视频或者插屏广告在展示
|
||||||
|
|
@ -27,7 +27,7 @@ namespace WZ
|
||||||
public void InitSDK(Action action)
|
public void InitSDK(Action action)
|
||||||
{
|
{
|
||||||
OnSplashAdCloseCallback = action;
|
OnSplashAdCloseCallback = action;
|
||||||
// 初始化广告平台状态
|
// 初始化广告平台状态,用于竞价失败后刷新
|
||||||
BidPlatformManager.Instance.InitializePlatformStates(AdConfigParser.GetAdExpireInSec());
|
BidPlatformManager.Instance.InitializePlatformStates(AdConfigParser.GetAdExpireInSec());
|
||||||
InitializeAdNetworks();
|
InitializeAdNetworks();
|
||||||
}
|
}
|
||||||
|
|
@ -65,12 +65,14 @@ namespace WZ
|
||||||
/// <param name="callback"></param>
|
/// <param name="callback"></param>
|
||||||
public void ShowRewardAd(string _adPos, Action<bool, double> _rewardCallback = null, Action _showFailedCallback = null)
|
public void ShowRewardAd(string _adPos, Action<bool, double> _rewardCallback = null, Action _showFailedCallback = null)
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("ShowRewardAd _adPos:"+_adPos+" ready:"+IsRewardAdReady());
|
||||||
AdsActionEvents.TrackAdPosition(AdsType.Rewarded, _adPos);
|
AdsActionEvents.TrackAdPosition(AdsType.Rewarded, _adPos);
|
||||||
if (!IsRewardAdReady())
|
if (!IsRewardAdReady())
|
||||||
{
|
{
|
||||||
_showFailedCallback?.Invoke();
|
_showFailedCallback?.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
AdsSDKManager.Instance.otherAdsOnShow = true;
|
||||||
PlatformType result = GetBestPlatformType(false);
|
PlatformType result = GetBestPlatformType(false);
|
||||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
||||||
if (result == PlatformType.AppLovin)
|
if (result == PlatformType.AppLovin)
|
||||||
|
|
@ -121,6 +123,7 @@ namespace WZ
|
||||||
_closeCallback = null;
|
_closeCallback = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
AdsSDKManager.Instance.otherAdsOnShow = true;
|
||||||
PlatformType result = GetBestPlatformType(true);
|
PlatformType result = GetBestPlatformType(true);
|
||||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Interstitial);
|
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Interstitial);
|
||||||
if (result == PlatformType.AppLovin)
|
if (result == PlatformType.AppLovin)
|
||||||
|
|
@ -219,6 +222,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
if (isInterstitial)
|
if (isInterstitial)
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("yangwu max price");
|
||||||
AdPriceInfo priceInfo = new AdPriceInfo(
|
AdPriceInfo priceInfo = new AdPriceInfo(
|
||||||
maxPrice: MaxAdsManager.Instance.GetInterstitialRevenue(),
|
maxPrice: MaxAdsManager.Instance.GetInterstitialRevenue(),
|
||||||
admobPrice: AdmobAdsManager.Instance.GetInterstitialRevenue(),
|
admobPrice: AdmobAdsManager.Instance.GetInterstitialRevenue(),
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ad8d5f86e3dbf4c9986fcd1981e0be68
|
guid: ad8d5f86e3dbf4c9986fcd1981e0be68
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class BigoAdsManager : NormalSingleton<BigoAdsManager>, IAdService
|
public class BigoAdsManager : D_MonoSingleton<BigoAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
public string ClientName => "Bigo";
|
public string ClientName => "Bigo";
|
||||||
public PlatformType Platfrom => PlatformType.Bigo;
|
public PlatformType Platfrom => PlatformType.Bigo;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 32bd7a6ecbc5e48da929eb774391fe49
|
guid: 32bd7a6ecbc5e48da929eb774391fe49
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c2a850afd5e804d71a3bda35898ee218
|
guid: c2a850afd5e804d71a3bda35898ee218
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1f8a13277f03d457ca5d5d19a6426b28
|
guid: 1f8a13277f03d457ca5d5d19a6426b28
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b8695a5a6cc14411892084d89818fdbe
|
guid: b8695a5a6cc14411892084d89818fdbe
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d0e4c55fdbb5b436f944b08b198aca51
|
guid: d0e4c55fdbb5b436f944b08b198aca51
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f0206a38823ea41d3af8ac3dad0e3381
|
guid: f0206a38823ea41d3af8ac3dad0e3381
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using AnyThinkAds.ThirdParty.LitJson;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
@ -23,6 +24,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdClicked"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdClosed(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
public static void TrackAdClosed(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||||
|
|
@ -41,11 +43,11 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdClosed"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdStartLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat)
|
public static void TrackAdStartLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat)
|
||||||
{
|
{
|
||||||
AdsSDKManager.Instance.otherAdsOnShow = true;
|
|
||||||
var eventName = "ad_start_load";
|
var eventName = "ad_start_load";
|
||||||
var dic = new Dictionary<string, object> {
|
var dic = new Dictionary<string, object> {
|
||||||
{ "ad_platform", adPlatform.ToString()},
|
{ "ad_platform", adPlatform.ToString()},
|
||||||
|
|
@ -54,6 +56,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdStartLoad"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdLoaded(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime)
|
public static void TrackAdLoaded(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime)
|
||||||
|
|
@ -69,6 +72,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdLoaded"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
public static void TrackAdFailToLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime, string reason)
|
public static void TrackAdFailToLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime, string reason)
|
||||||
{
|
{
|
||||||
|
|
@ -84,6 +88,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdFailToLoad"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
||||||
|
|
@ -99,6 +104,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdFailToShow"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdPosition(AdsType adFormat, string pos)
|
public static void TrackAdPosition(AdsType adFormat, string pos)
|
||||||
|
|
@ -111,6 +117,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdPosition"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdImpression(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
public static void TrackAdImpression(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||||
|
|
@ -128,6 +135,7 @@ namespace WZ
|
||||||
};
|
};
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dic);
|
||||||
ShuShuEvent.Instance.Track(eventName, dic);
|
ShuShuEvent.Instance.Track(eventName, dic);
|
||||||
|
LoggerUtils.Debug("[actionevent] TrackAdImpression"+JsonMapper.ToJson(dic));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 119ab55aa6c4f47b4b70af88ad977987
|
guid: 119ab55aa6c4f47b4b70af88ad977987
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdsKeyEvents : NormalSingleton<AdsKeyEvents>
|
public class AdsKeyEvents : D_MonoSingleton<AdsKeyEvents>
|
||||||
{
|
{
|
||||||
private List<AdCountData> _adCountData = new List<AdCountData>();
|
private List<AdCountData> _adCountData = new List<AdCountData>();
|
||||||
private List<AdFPUData> _adFPUData = new List<AdFPUData>();
|
private List<AdFPUData> _adFPUData = new List<AdFPUData>();
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d9c7ae999fc264fa6ad5106900a2b381
|
guid: d9c7ae999fc264fa6ad5106900a2b381
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,15 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>, IAdService
|
public class KwaiAdsManager : D_MonoSingleton<KwaiAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
//目前都是测试id
|
//目前都是测试id
|
||||||
private string _appId = "";
|
private string _appId = "";
|
||||||
private string _token = "";
|
private string _token = "";
|
||||||
public string _rewardAdUnitId = "";
|
public string _rewardAdUnitId = "";
|
||||||
public string _interstitialAdUnitId = "";
|
public string _interstitialAdUnitId = "";
|
||||||
public double _rewardAdRevenue = 0;
|
public double _rewardAdRevenue = -1;
|
||||||
public double _interstitiaAdRevenue = 0;
|
public double _interstitiaAdRevenue = -1;
|
||||||
private IRewardAdController _rewardAdController;
|
private IRewardAdController _rewardAdController;
|
||||||
private IInterstitialAdController _interstitialAdController;
|
private IInterstitialAdController _interstitialAdController;
|
||||||
public string _rvPos;
|
public string _rvPos;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class MaxAdsManager : NormalSingleton<MaxAdsManager>, IAdService
|
public class MaxAdsManager : D_MonoSingleton<MaxAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
public string ClientName => "AppLovin";
|
public string ClientName => "AppLovin";
|
||||||
public PlatformType Platfrom => PlatformType.AppLovin;
|
public PlatformType Platfrom => PlatformType.AppLovin;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cfac40dd2d010471d9cefd15bd2e7fcb
|
guid: cfac40dd2d010471d9cefd15bd2e7fcb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class TpnAdsManager : NormalSingleton<TpnAdsManager>, IAdService
|
public class TpnAdsManager : D_MonoSingleton<TpnAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
public string ClientName => "Topon";
|
public string ClientName => "Topon";
|
||||||
public PlatformType Platfrom => PlatformType.Topon;
|
public PlatformType Platfrom => PlatformType.Topon;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: fb96ca447b9164f92ad5f7fa33f7263f
|
guid: fb96ca447b9164f92ad5f7fa33f7263f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c1122fdef681d4e25898cbff43f3cff7
|
guid: c1122fdef681d4e25898cbff43f3cff7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 251647f5afc7f4b58af8b52aa55f9d2c
|
guid: 251647f5afc7f4b58af8b52aa55f9d2c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,15 @@ namespace WZ
|
||||||
private static object m_kwaiObj = "m_kwaiObj";
|
private static object m_kwaiObj = "m_kwaiObj";
|
||||||
public static PlatformType GetPlatformType(AdPriceInfo priceInfo)
|
public static PlatformType GetPlatformType(AdPriceInfo priceInfo)
|
||||||
{
|
{
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
#if UNITY_ANDROID && UNITY_EDITOR
|
||||||
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||||
{
|
{
|
||||||
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
||||||
AndroidJavaObject toponCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.ToponAdUnitId, m_toponObj);
|
AndroidJavaObject toponCustomContentInfo = new AndroidJavaObject("com.thinkup.core.api.TUCustomContentInfo", priceInfo.ToponAdUnitId, m_toponObj);
|
||||||
AndroidJavaObject admobCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.AdmobPrice * 1000, m_admobObj);
|
AndroidJavaObject admobCustomContentInfo = new AndroidJavaObject("com.thinkup.core.api.TUCustomContentInfo", priceInfo.AdmobPrice * 1000, m_admobObj);
|
||||||
AndroidJavaObject maxCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.MaxPrice * 1000, m_maxObj);
|
AndroidJavaObject maxCustomContentInfo = new AndroidJavaObject("com.thinkup.core.api.TUCustomContentInfo", priceInfo.MaxPrice * 1000, m_maxObj);
|
||||||
AndroidJavaObject bigoCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.BigoPrice * 1000, m_bigoObj);
|
AndroidJavaObject bigoCustomContentInfo = new AndroidJavaObject("com.thinkup.core.api.TUCustomContentInfo", priceInfo.BigoPrice * 1000, m_bigoObj);
|
||||||
AndroidJavaObject kwaiCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.KwaiPrice * 1000, m_kwaiObj);
|
AndroidJavaObject kwaiCustomContentInfo = new AndroidJavaObject("com.thinkup.core.api.TUCustomContentInfo", priceInfo.KwaiPrice * 1000, m_kwaiObj);
|
||||||
|
|
||||||
|
|
||||||
AndroidJavaObject atCustomContentInfoList = new AndroidJavaObject("java.util.ArrayList");
|
AndroidJavaObject atCustomContentInfoList = new AndroidJavaObject("java.util.ArrayList");
|
||||||
atCustomContentInfoList.Call<bool>("add", toponCustomContentInfo);
|
atCustomContentInfoList.Call<bool>("add", toponCustomContentInfo);
|
||||||
|
|
@ -48,8 +47,7 @@ namespace WZ
|
||||||
atCustomContentInfoList.Call<bool>("add", maxCustomContentInfo);
|
atCustomContentInfoList.Call<bool>("add", maxCustomContentInfo);
|
||||||
atCustomContentInfoList.Call<bool>("add", bigoCustomContentInfo);
|
atCustomContentInfoList.Call<bool>("add", bigoCustomContentInfo);
|
||||||
atCustomContentInfoList.Call<bool>("add", kwaiCustomContentInfo);
|
atCustomContentInfoList.Call<bool>("add", kwaiCustomContentInfo);
|
||||||
|
AndroidJavaClass sdkGlobalSetting = new AndroidJavaClass("com.thinkup.core.api.TUSDKGlobalSetting");
|
||||||
AndroidJavaClass sdkGlobalSetting = new AndroidJavaClass("com.anythink.core.api.ATSDKGlobalSetting");
|
|
||||||
AndroidJavaObject maxPriceCustomContentInfo = sdkGlobalSetting.CallStatic<AndroidJavaObject>("customContentReviewResult", atCustomContentInfoList);
|
AndroidJavaObject maxPriceCustomContentInfo = sdkGlobalSetting.CallStatic<AndroidJavaObject>("customContentReviewResult", atCustomContentInfoList);
|
||||||
|
|
||||||
string customContentString = maxPriceCustomContentInfo.Get<string>("customContentString");
|
string customContentString = maxPriceCustomContentInfo.Get<string>("customContentString");
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9f4bb1420fa8442e7961c82f0f49e483
|
guid: 9f4bb1420fa8442e7961c82f0f49e483
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ namespace WZ
|
||||||
return expiredAdTypes;
|
return expiredAdTypes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class BidPlatformManager : NormalSingleton<BidPlatformManager>
|
public class BidPlatformManager : D_MonoSingleton<BidPlatformManager>
|
||||||
{
|
{
|
||||||
private Dictionary<PlatformType, BidPlatformState> _platformStates = new Dictionary<PlatformType, BidPlatformState>();
|
private Dictionary<PlatformType, BidPlatformState> _platformStates = new Dictionary<PlatformType, BidPlatformState>();
|
||||||
private int _bidExpireInSec = -1;
|
private int _bidExpireInSec = -1;
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8b14631fb6b6547ee9890a43a8ecb2a7
|
guid: 8b14631fb6b6547ee9890a43a8ecb2a7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b1a8b2d9a81c545768a7085cbd43f3d5
|
guid: b1a8b2d9a81c545768a7085cbd43f3d5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using AdjustSdk;
|
||||||
using EFSDK;
|
using EFSDK;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
|
using GoogleMobileAds.Api;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using ThinkingAnalytics;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
|
|
@ -132,22 +135,118 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
|
||||||
|
|
||||||
public bool IsNativeFullReady()
|
public bool IsNativeFullReady()
|
||||||
{
|
{
|
||||||
return false;
|
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||||
|
return AdsSDKManager.Instance.IsNativeAdReady(adUnitId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowFullNative(string position, Action<bool, double> callback = null)
|
public void ShowFullNative(RectTransform rectTransform, Camera pCom = null, string position = "")
|
||||||
{
|
{
|
||||||
|
if (!IsNativeFullReady())
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowNative(RectTransform rectTransform, Camera camera = null, string position = "")
|
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||||
|
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||||
{
|
{
|
||||||
|
TemplateId = NativeTemplateId.Medium,
|
||||||
|
MainBackgroundColor = Color.white
|
||||||
|
}, rectTransform, pCom);
|
||||||
|
|
||||||
|
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideFullNative()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||||
|
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsNativeReady()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobNativeId;
|
||||||
|
return AdsSDKManager.Instance.IsNativeAdReady(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowNative(RectTransform rectTransform, Camera pCom = null, string position = "")
|
||||||
|
{
|
||||||
|
if (!IsNativeReady())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var adUnitId = StaticValue.AdmobNativeId;
|
||||||
|
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||||
|
{
|
||||||
|
TemplateId = NativeTemplateId.Medium,
|
||||||
|
MainBackgroundColor = Color.white
|
||||||
|
}, rectTransform, pCom);
|
||||||
|
|
||||||
|
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideNative()
|
public void HideNative()
|
||||||
{
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobNativeId;
|
||||||
|
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsSmallNativeReady()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||||
|
return AdsSDKManager.Instance.IsNativeAdReady(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowSmallNative(RectTransform rectTransform, Camera pCom = null, string position = "")
|
||||||
|
{
|
||||||
|
if (!IsSmallNativeReady())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||||
|
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||||
|
{
|
||||||
|
TemplateId = NativeTemplateId.Medium,
|
||||||
|
MainBackgroundColor = Color.white
|
||||||
|
}, rectTransform, pCom);
|
||||||
|
|
||||||
|
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideSmallNative()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||||
|
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsMinddleNativeReady()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobMinddleNativeId;
|
||||||
|
return AdsSDKManager.Instance.IsNativeAdReady(adUnitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowMinddleNative(RectTransform rectTransform, Camera pCom = null, string position = "")
|
||||||
|
{
|
||||||
|
if (!IsSmallNativeReady())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var adUnitId = StaticValue.AdmobMinddleNativeId;
|
||||||
|
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||||
|
{
|
||||||
|
TemplateId = NativeTemplateId.Medium,
|
||||||
|
MainBackgroundColor = Color.white
|
||||||
|
}, rectTransform, pCom);
|
||||||
|
|
||||||
|
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideMinddleNative()
|
||||||
|
{
|
||||||
|
var adUnitId = StaticValue.AdmobMinddleNativeId;
|
||||||
|
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -573,36 +672,97 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
|
||||||
|
|
||||||
public string GetGaid()
|
public string GetGaid()
|
||||||
{
|
{
|
||||||
return null;
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "gaid";
|
||||||
|
}
|
||||||
|
return AdjustManager.Instance.GetGdid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetAndroidId()
|
public string GetAndroidId()
|
||||||
{
|
{
|
||||||
return null;
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "androidid";
|
||||||
|
}
|
||||||
|
string androidId = "unknown";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||||
|
using (AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||||
|
using (AndroidJavaClass settingsSecure = new AndroidJavaClass("android.provider.Settings$Secure"))
|
||||||
|
{
|
||||||
|
// 调用 Settings.Secure.getString() 方法获取 ANDROID_ID
|
||||||
|
androidId = settingsSecure.CallStatic<string>(
|
||||||
|
"getString",
|
||||||
|
currentActivity.Call<AndroidJavaObject>("getContentResolver"),
|
||||||
|
"android_id"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
LoggerUtils.Error("获取 Android ID 出错: " + e.Message);
|
||||||
|
}
|
||||||
|
return androidId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetAdid()
|
public string GetAdid()
|
||||||
{
|
{
|
||||||
return null;
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "adid";
|
||||||
|
}
|
||||||
|
return AdjustManager.Instance.GetAdid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetUserAgent()
|
public string GetUserAgent()
|
||||||
{
|
{
|
||||||
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "GetUserAgent";
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 获取Java的System类
|
||||||
|
using (AndroidJavaClass systemClass = new AndroidJavaClass("java.lang.System"))
|
||||||
|
{
|
||||||
|
// 调用System.getProperty("http.agent")方法
|
||||||
|
string httpAgent = systemClass.CallStatic<string>("getProperty", "http.agent");
|
||||||
|
return httpAgent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError("获取http.agent失败: " + e.Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetSSAccountId()
|
public string GetSSAccountId()
|
||||||
{
|
{
|
||||||
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "GetSSAccountId";
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetSSDistinctId()
|
public string GetSSDistinctId()
|
||||||
{
|
{
|
||||||
return null;
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "GetSSDistinctId";
|
||||||
|
}
|
||||||
|
return ThinkingAnalyticsAPI.GetDistinctId();;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetSSSuperProperties()
|
public string GetSSSuperProperties()
|
||||||
{
|
{
|
||||||
return null;
|
if (Application.isEditor)
|
||||||
|
{
|
||||||
|
return "GetSSSuperProperties";
|
||||||
|
}
|
||||||
|
return ThinkingAnalyticsAPI.GetSuperProperties().ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class EFSdkManager : NormalSingleton<EFSdkManager>
|
public class EFSdkManager : D_MonoSingleton<EFSdkManager>
|
||||||
{
|
{
|
||||||
private const string KEY_OKSPIN_SHOW_COUNT = "OKSPIN_SHOW_COUNT";
|
private const string KEY_OKSPIN_SHOW_COUNT = "OKSPIN_SHOW_COUNT";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace WZ
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Firebase analytics事件上报
|
/// Firebase analytics事件上报
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager>
|
public class FireBaseAnalyticsManager : D_MonoSingleton<FireBaseAnalyticsManager>
|
||||||
{
|
{
|
||||||
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigManager>
|
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
||||||
{
|
{
|
||||||
public void FetchRemoteConfig()
|
public void FetchRemoteConfig()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
public class FireBaseSDKManager : D_MonoSingleton<FireBaseSDKManager>
|
||||||
{
|
{
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using ThinkingData.Analytics;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
public class ShuShuEvent : D_MonoSingleton<ShuShuEvent>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置用户属性
|
/// 设置用户属性
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,12 @@ using ThinkingData.Analytics;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace WZ
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
public class ShuShuMangage : D_MonoSingleton<ShuShuMangage>
|
||||||
{
|
{
|
||||||
private const string appid = "80f6819a81c743cbad667ecf242f3133";
|
|
||||||
private const string server = "https://global-receiver-ta.thinkingdata.cn";
|
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
// 初始化SDK
|
// 初始化SDK
|
||||||
TDAnalytics.Init(appid, server);
|
TDAnalytics.Init(StaticValue.TDAppID, StaticValue.TDServerURL);
|
||||||
//开启自动采集事件
|
//开启自动采集事件
|
||||||
TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
|
TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
|
||||||
//如果用户已登录,可以设置用户的账号ID作为身份唯一标识
|
//如果用户已登录,可以设置用户的账号ID作为身份唯一标识
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: be1bd83cd48f44fa59b93f7ee10ec4fc
|
guid: be1bd83cd48f44fa59b93f7ee10ec4fc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -18,25 +18,25 @@ namespace WZ
|
||||||
public static void Debug(object message, Object context = null)
|
public static void Debug(object message, Object context = null)
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!_enabled) return;
|
||||||
Log($"[DEBUG] {message}", context);
|
Log($"[DEBUG][WZSDK] {message}", context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Info(object message, Object context = null)
|
public static void Info(object message, Object context = null)
|
||||||
{
|
{
|
||||||
if (!!_enabled) return;
|
if (!!_enabled) return;
|
||||||
Log($"[INFO] {message}", context);
|
Log($"[INFO][WZSDK] {message}", context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Warning(object message, Object context = null)
|
public static void Warning(object message, Object context = null)
|
||||||
{
|
{
|
||||||
if (!_enabled) return;
|
if (!_enabled) return;
|
||||||
Log($"[WARNING] {message}", context);
|
Log($"[WARNING][WZSDK] {message}", context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Error(object message, Object context = null)
|
public static void Error(object message, Object context = null)
|
||||||
{
|
{
|
||||||
if (!!_enabled) return;
|
if (!!_enabled) return;
|
||||||
Log($"[ERROR] {message}", context);
|
Log($"[ERROR][WZSDK] {message}", context);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Log(string message, Object context = null)
|
private static void Log(string message, Object context = null)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7e6c7794484654e39acf594e7200206a
|
guid: 7e6c7794484654e39acf594e7200206a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b2572c2555e654d5aad4a845312b20e9
|
guid: b2572c2555e654d5aad4a845312b20e9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: eb54f82607e0946e4ac5cbfb0ca49967
|
guid: eb54f82607e0946e4ac5cbfb0ca49967
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6e18cf88978e94ad4bd074b3a427bbc9
|
guid: 6e18cf88978e94ad4bd074b3a427bbc9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue