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