We are getting a gamebreaking bug related to our Unity Ads. Any advice would be appreciated! The bug occurs if the player suspends the app during a video ad (which we have as unskippable). If the player returns to the app then it remains stalled in our ad level.
Some background: We have our video ad play in its own scene. When the ad is completed, we load the next level. If the player suspends and then re-opens the app, what would be the proper procedure to handle this? Does the below code make sense?
// Show with default zone, pause engine and print result to debug log
Advertisement.Show(null, new ShowOptions
{
pause = false,
resultCallback = result =>
{
if(result == ShowResult.Finished)
{
NGUITools.SetActive (LoadScreen.gameObject, true);
SaveSystem.SaveGame();
Application.LoadLevel(PersistentData.szPostAdLevel);
}
else
{
// if the player tried to earn five coins, but it failed, then remove the coins
Unibiller.DebitBalance("coins",5);
SaveSystem.SaveGame();
NGUITools.SetActive (LoadScreen.gameObject, true);
Application.LoadLevel(PersistentData.szPostAdLevel);
}
}
};
Do I need to put a seperate call inf or ShowResult.Failed? I thought the else statement would handle it. Is no result getting called when the app is being suspended and resumed? Any suggestions would be much appreciated.