Merge branch 'main' of http://v4.9ms.co:7777/yufeng/SDK_UnityMoney
This commit is contained in:
commit
f38e306cf4
|
@ -7,17 +7,19 @@ using WZ;
|
||||||
|
|
||||||
public class AdjustManager : D_MonoSingleton<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 : D_MonoSingleton<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 : D_MonoSingleton<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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,48 @@
|
||||||
using AdjustSdk;
|
using System.Collections.Generic;
|
||||||
using Firebase.RemoteConfig;
|
using AdjustSdk;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using UnityEngine;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
|
|
||||||
public class AdjustTrackEvent : D_MonoSingleton<AdjustTrackEvent>
|
public class AdjustTrackEvent : D_MonoSingleton<AdjustTrackEvent>
|
||||||
{
|
{
|
||||||
|
private Dictionary<string, string> eventTokenMap;
|
||||||
|
|
||||||
|
|
||||||
|
private string GetEventToken(string eventName)
|
||||||
|
{
|
||||||
|
if (eventTokenMap == null)
|
||||||
|
{
|
||||||
|
UpdateEventToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventTokenMap == null || eventTokenMap.Count == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return eventTokenMap.GetValueOrDefault(eventName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateEventToken()
|
||||||
|
{
|
||||||
|
var remoteConfigString = FireBaseRemoteConfigManager.Instance.GetRemoteConfigString("event_adjust_set");
|
||||||
|
if (string.IsNullOrEmpty(remoteConfigString)) return;
|
||||||
|
|
||||||
|
var deserializeObject = JsonConvert.DeserializeObject<Dictionary<string, string>>(remoteConfigString);
|
||||||
|
if (eventTokenMap == null)
|
||||||
|
{
|
||||||
|
eventTokenMap = deserializeObject;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var keyValuePair in deserializeObject)
|
||||||
|
{
|
||||||
|
eventTokenMap[keyValuePair.Key] = keyValuePair.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// adjust事件上报
|
/// adjust事件上报
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -16,6 +53,32 @@ public class AdjustTrackEvent : D_MonoSingleton<AdjustTrackEvent>
|
||||||
Adjust.TrackEvent(adjustEvent);
|
Adjust.TrackEvent(adjustEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会将eventName 转化成 token 进行上报
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="eventName"></param>
|
||||||
|
/// <param name="extraInfo"></param>
|
||||||
|
public void TrackEventName(string eventName, Dictionary<string, object> extraInfo)
|
||||||
|
{
|
||||||
|
var eventToken = GetEventToken(eventName);
|
||||||
|
if (string.IsNullOrEmpty(eventToken))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var adjustEvent = new AdjustEvent(eventToken);
|
||||||
|
if (extraInfo != null)
|
||||||
|
{
|
||||||
|
foreach (var keyValuePair in extraInfo)
|
||||||
|
{
|
||||||
|
adjustEvent.AddPartnerParameter(keyValuePair.Key, keyValuePair.Value.ToString());
|
||||||
|
adjustEvent.AddCallbackParameter(keyValuePair.Key, keyValuePair.Value.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Adjust.TrackEvent(adjustEvent);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 广告收益上报
|
/// 广告收益上报
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -47,6 +110,7 @@ public class AdjustTrackEvent : D_MonoSingleton<AdjustTrackEvent>
|
||||||
{
|
{
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
var revenueAdjs = JsonConvert.DeserializeObject<RevenueData[]>(json);
|
var revenueAdjs = JsonConvert.DeserializeObject<RevenueData[]>(json);
|
||||||
if (revenueAdjs == null && revenueAdjs.Length == 0)
|
if (revenueAdjs == null && revenueAdjs.Length == 0)
|
||||||
{
|
{
|
||||||
|
@ -59,8 +123,9 @@ public class AdjustTrackEvent : D_MonoSingleton<AdjustTrackEvent>
|
||||||
{
|
{
|
||||||
totalRate += item.rate;
|
totalRate += item.rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始随机
|
//开始随机
|
||||||
int randomValue = UnityEngine.Random.Range(0, totalRate);
|
int randomValue = Random.Range(0, totalRate);
|
||||||
int accumulatedRate = 0;
|
int accumulatedRate = 0;
|
||||||
|
|
||||||
//根据随机值定位
|
//根据随机值定位
|
||||||
|
|
|
@ -42,12 +42,13 @@ namespace WZ
|
||||||
//
|
//
|
||||||
MobileAds.Initialize(initStatus =>
|
MobileAds.Initialize(initStatus =>
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("[Admob] init success");
|
||||||
|
});
|
||||||
|
|
||||||
if (_bannerAdUnits.Count > 0) LoadBanner();
|
if (_bannerAdUnits.Count > 0) LoadBanner();
|
||||||
if (_interstitialAdUnits.Count > 0) LoadInterstitial();
|
if (_interstitialAdUnits.Count > 0) LoadInterstitial();
|
||||||
if (_rewardedAdUnits.Count > 0) LoadRewarded();
|
if (_rewardedAdUnits.Count > 0) LoadRewarded();
|
||||||
if(_splashAdUnits.Count > 0) AdsSplashManager.Instance.InitSplash();
|
if(_splashAdUnits.Count > 0) AdsSplashManager.Instance.InitSplash();
|
||||||
LoggerUtils.Debug("[Admob] init success");
|
|
||||||
});
|
|
||||||
|
|
||||||
if (_nativeAdUnits.Count > 0)
|
if (_nativeAdUnits.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
||||||
|
@ -158,18 +257,25 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
|
||||||
{
|
{
|
||||||
ShuShuEvent.Instance.Track(eventName);
|
ShuShuEvent.Instance.Track(eventName);
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName);
|
||||||
|
AdjustTrackEvent.Instance.TrackEventName(eventName, new Dictionary<string, object>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LogEvent(string eventName, string key1, object value1)
|
public void LogEvent(string eventName, string key1, object value1)
|
||||||
{
|
{
|
||||||
ShuShuEvent.Instance.Track(eventName, key1, value1);
|
ShuShuEvent.Instance.Track(eventName, key1, value1);
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, key1, value1);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, key1, value1);
|
||||||
|
AdjustTrackEvent.Instance.TrackEventName(eventName, new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
[key1] = value1
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LogEvent(string eventName, Dictionary<string, object> extraInfo)
|
public void LogEvent(string eventName, Dictionary<string, object> extraInfo)
|
||||||
{
|
{
|
||||||
ShuShuEvent.Instance.Track(eventName, extraInfo);
|
ShuShuEvent.Instance.Track(eventName, extraInfo);
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, extraInfo);
|
FireBaseAnalyticsManager.Instance.LogEvent(eventName, extraInfo);
|
||||||
|
AdjustTrackEvent.Instance.TrackEventName(eventName, extraInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -566,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,18 +8,17 @@ namespace WZ
|
||||||
{
|
{
|
||||||
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
||||||
{
|
{
|
||||||
public bool IsInitialized { get; private set; }
|
|
||||||
public void FetchRemoteConfig()
|
public void FetchRemoteConfig()
|
||||||
{
|
{
|
||||||
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
|
// Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
|
||||||
{
|
// {
|
||||||
if (task.Result == Firebase.DependencyStatus.Available)
|
// if (task.Result == Firebase.DependencyStatus.Available)
|
||||||
{
|
// {
|
||||||
Firebase.RemoteConfig.FirebaseRemoteConfig.DefaultInstance.FetchAsync(TimeSpan.Zero).ContinueWithOnMainThread(task =>
|
Firebase.RemoteConfig.FirebaseRemoteConfig.DefaultInstance.FetchAsync(TimeSpan.Zero).ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
FirebaseRemoteConfig.DefaultInstance.ActivateAsync().ContinueWithOnMainThread(task =>
|
FirebaseRemoteConfig.DefaultInstance.ActivateAsync().ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
IsInitialized = true;
|
AdjustTrackEvent.Instance.UpdateEventToken();
|
||||||
// 获取广告位信息
|
// 获取广告位信息
|
||||||
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
||||||
// 刷新广告位信息
|
// 刷新广告位信息
|
||||||
|
@ -38,8 +37,8 @@ namespace WZ
|
||||||
// 检查Adjust归因
|
// 检查Adjust归因
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GroupSet()
|
private void GroupSet()
|
||||||
|
|
|
@ -11,10 +11,10 @@ namespace WZ
|
||||||
{
|
{
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
if (Application.isEditor)
|
// if (Application.isEditor)
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
InitSDK();
|
InitSDK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,10 @@ namespace WZ
|
||||||
{
|
{
|
||||||
public class ShuShuMangage : D_MonoSingleton<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作为身份唯一标识
|
||||||
|
|
Loading…
Reference in New Issue