[U] ad plugins
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using AppsFlyerSDK;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class OneLinkTest : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private RootCtx ctx;
|
||||
|
||||
[SerializeField] private GameObject btnContainer;
|
||||
|
||||
[SerializeField] private GameObject btn;
|
||||
@@ -13,10 +17,26 @@ public class OneLinkTest : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
var aFInit = new AFInit();
|
||||
ctx.OnInited += OnContextInited;
|
||||
}
|
||||
|
||||
// Callback from GContex when its ready
|
||||
private void OnContextInited()
|
||||
{
|
||||
Boost();
|
||||
}
|
||||
|
||||
private async void Boost()
|
||||
{
|
||||
await Awaiters.NextFrame;
|
||||
|
||||
TaInit();
|
||||
InitAppsFlyer();
|
||||
|
||||
var aFInit = new AFInit();
|
||||
aFInit.text = message;
|
||||
// Get funcs methods witch has Btn attribute
|
||||
aFInit.text.text = $"Init AF {AppsFlyer.CallBackObjectName}\n";;
|
||||
|
||||
var methods = aFInit.GetType().GetMethods();
|
||||
foreach (var method in methods)
|
||||
{
|
||||
@@ -30,7 +50,45 @@ public class OneLinkTest : MonoBehaviour
|
||||
btnObj.GetComponent<Button>().onClick.AddListener(() => method.Invoke(aFInit, null));
|
||||
btnObj.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void TaInit()
|
||||
{
|
||||
var taAppId = GConstant.TA_APPID;
|
||||
var taUrl = GConstant.TA_URL;
|
||||
var autoTrackEventType = ThinkingData.Analytics.TDAutoTrackEventType.AppStart
|
||||
| ThinkingData.Analytics.TDAutoTrackEventType.AppEnd
|
||||
| ThinkingData.Analytics.TDAutoTrackEventType.AppInstall;
|
||||
|
||||
ThinkingData.Analytics.TDAnalytics.Init(taAppId, taUrl);
|
||||
ThinkingData.Analytics.TDAnalytics.EnableThirdPartySharing(ThinkingData.Analytics.Utils.TDThirdPartyType.APPSFLYER);
|
||||
ThinkingData.Analytics.TDAnalytics.EnableAutoTrack(autoTrackEventType);
|
||||
ThinkingData.Analytics.TDAnalytics.EnableLog(false);
|
||||
|
||||
Debug.Log("[GEvent::TaInit] ThinkingData inited");
|
||||
}
|
||||
|
||||
private static void InitAppsFlyer()
|
||||
{
|
||||
var afKey = GConstant.AF_KEY;
|
||||
var afAppID = GConstant.AF_APPID;
|
||||
var afOneLinkID = GConstant.AF_OneLinkID;
|
||||
var afCustomerUserID = ThinkingData.Analytics.TDAnalytics.GetDistinctId();
|
||||
AFDeepLinkHelper.Instance.Init(afKey,afAppID,afCustomerUserID,afOneLinkID,true);
|
||||
Debug.Log("[GEvent::InitAppsFlyer] AppsFlyer inited");
|
||||
}
|
||||
}
|
||||
|
||||
public class GConstant
|
||||
{
|
||||
public const string TA_URL = "https://ta-event.bamboogames.fun";
|
||||
public const string TA_APPID = "9876bb56ee484b528064d1db40a57ec4";
|
||||
|
||||
public const string AF_KEY = "rSySeWtvKabfbPZE7Lmx7C";
|
||||
public const string AF_APPID = "6505145935";
|
||||
public const string AF_OneLinkID = "jT1Q";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user