Search Unity

How to stop AppOpenAd showing multiple times?

Discussion in 'iOS and tvOS' started by TeaAndBiscuits, Sep 22, 2022.

  1. TeaAndBiscuits

    TeaAndBiscuits

    Joined:
    Nov 11, 2014
    Posts:
    5
    Hey folks, so I have implemented AppOpenAds from Admob, they work as intended...To a point.

    Unfortunately, when the viewer is watching a 'rewarded' video (ie to get coins in-game) after it finishes, it then shows an AppOpenAd, as it obviously thinks the user has left the app (when they have just watched a video instead).

    Is there any way I can stop this?

    It's using this;

    private void OnAppStateChanged(AppState state)
    {
    // Display the app open ad when the app is foregrounded.
    UnityEngine.Debug.Log("App State is " + state);
    if (state == AppState.Foreground)
    {
    AppOpenAdManager.Instance.ShowAdIfAvailable();
    }
    }

    Thanks in advance :)