Add TapADN smart preload attribution

This commit is contained in:
2026-06-05 21:44:35 +08:00
parent 09fe0f0f35
commit 3341169f9b
12 changed files with 1133 additions and 7 deletions

View File

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