Ad frequency reduced

This commit is contained in:
Savya Bikram Shah
2026-06-07 14:17:07 +05:45
parent a07f7618ab
commit 144bac177f
2 changed files with 438 additions and 12 deletions

View File

@@ -28,6 +28,7 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
private IDisposable _selectedSub;
private IDisposable _returnToMainMenuSubscription;
private bool _navigatingToGameplay;
private int _selectCount;
private CancellationTokenSource _scopeCts;
public ColorbookFlowController(
@@ -110,9 +111,14 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
_loadingScreen.Show();
_loadingScreen.SetProgress(0f);
// Fire the interstitial but never await it: the ad overlays the transition while the level
// loads underneath, so a missed/dropped ad callback can't stall the flow at 0% anymore.
// Frequency cap: show an interstitial on every 2nd level open (2nd, 4th, ...). On skip turns
// just keep one prewarmed so the next show has an ad ready. Fire-and-forget either way — the
// ad overlays the transition while the level loads underneath, so a missed/dropped ad callback
// can't stall the flow at 0% anymore.
if (++_selectCount % 2 == 0)
ShowInterstitialAdAsync(ct).Forget();
else
PrewarmInterstitialAdAsync(ct).Forget();
try
{

File diff suppressed because one or more lines are too long