App restarts after watching Ad

I’m having an issue where the app restarts when I finish watching an Ad. The strange part is that I’m calling the exact same code ShowRewardedVideo() from 2 other places in the App and the ads play and return to the game without a problem.

The only difference I can see is that the one that isn’t working is called from a class that isn’t a
MonoBehaviour (if that makes a difference).

I’ve tested it many times to see if it’s just coincidence that it’s happening from one place but not the other.

    string m_rewardedPlacementId = "rewardedVideo";

    bool m_testMode = true;

    void Start ()
    {
        Advertisement.AddListener (this);

        // Initialize the Ads with the ID and the testing mode
        Advertisement.Initialize (gameId, m_testMode);
    }

    public bool RewardedAdIsAvailable()
    {
        return Advertisement.IsReady(m_rewardedPlacementId);
    }

//--- Showing the Ads
    // Shows a rewarded Ad to the player
    public void ShowRewardedVideo()
    {
        if(RewardedAdIsAvailable())
        {
            Advertisement.Show (m_rewardedPlacementId);
        }
    }

Has anyone else had similar issues?

It’s not the “Don’t keep activities” as that is turned off on my phone, which seems to be causing the problem for everyone else.

Thanks

The Monobehaviour inheritance can make a difference if Unity engine is not ready when returning to the game from the ad and you’re trying to call some of the engine API from outside it (from a non Monobehavior object) before it wakes up. Do you have any device logs available?

Thanks @mikaisomaa , I’ve narrowed it down to being caused by some of the UI updating as soon as the game comes in focus, so if I wait a frame it’s working fine (the other places where ads where shown weren’t refreshing the UI in the same way). I’m having trouble getting device logs off my phone but will send them when I can.

Unfortunately I’ve run into the same issue and I don’t have a clue what’s wrong. Do somebody have an ultimate solution for this?