Add TapADN smart preload attribution

This commit is contained in:
2026-06-05 21:44:35 +08:00
parent c21bdec3fe
commit fd98a7f541
48 changed files with 9441 additions and 18 deletions

View File

@@ -56,10 +56,12 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
}
curState = 1;
TapadnSmartLoadOrchestrator.OnLoadStarted(AD_Type.Splash, AdScene);
_adNative.LoadSplashAd(
TapadnAdRequestFactory.BuildSplash(Key, TapadnAdController.CurrentOptions),
ad =>
{
TapadnSmartLoadOrchestrator.OnLoadResult(AD_Type.Splash, AdScene, true);
_loadedAd?.Destroy();
_loadedAd = ad;
_loadedAd.Shown += OnManualShown;
@@ -71,6 +73,7 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
},
error =>
{
TapadnSmartLoadOrchestrator.OnLoadResult(AD_Type.Splash, AdScene, false);
curState = 0;
Debug.LogError($"[TapADN] Splash load failed. code={error.Code}, message={error.Message}");
});
@@ -103,6 +106,7 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
}
_showSettled = true;
TapadnSmartLoadOrchestrator.OnShowError(AD_Type.Splash, AdScene);
curState = 0;
Debug.LogError($"[TapADN] Splash show failed. code={error?.Code}, message={error?.Message}");
adListener.OnShowError();
@@ -110,6 +114,7 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
public void OnAdShow()
{
TapadnSmartLoadOrchestrator.OnShowStart(AD_Type.Splash, AdScene);
NotifyShowStarted();
}
@@ -129,6 +134,16 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
{
}
public override void OnPlayRequestStarted()
{
TapadnSmartLoadOrchestrator.OnPlayRequestStarted(AD_Type.Splash, AdScene, !UseAutoLoad() && IsReadly());
}
public override void EnterAdScenario(string scenario)
{
TapadnSmartLoadOrchestrator.OnEnterAdScenario(AD_Type.Splash, scenario, Key);
}
private bool UseAutoLoad()
{
return TapadnAdController.CurrentOptions?.SplashAutoLoad ?? true;
@@ -136,6 +151,7 @@ public sealed class TapadnSplashPlayer : ADPlayer, IDirichletSplashAutoAdListene
private void OnManualShown()
{
TapadnSmartLoadOrchestrator.OnShowStart(AD_Type.Splash, AdScene);
NotifyShowStarted();
}