I have a button with assigned code:
public void QuitGame()
{
ShowAd();
Application.Quit();
}
public void ShowAd()
{
Advertisement.Show();
}
That’s the simple version. In editor it works fine, pressing button shows screen that says it is an add screen.
After building apk, pressing the button simply causes game to exit, without playing any advert.
Other code:
public void QuitGame()
{
ShowAd();
}
public void ShowAd()
{
if (Advertisement.IsReady())
{
Advertisement.Show("video", new ShowOptions() {resultCallback = HandleAdResult});
}
}
private void HandleAdResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Application.Quit();
break;
case ShowResult.Skipped:
Application.Quit();
break;
case ShowResult.Failed:
Application.Quit();
break;
}
}
For simplicity, I did not add any extra code for different Results, just Application.Quit(). After building this, the ad sometimes plays, sometimes does not. If it plays, everything works fine, game quits after. If it does not, pressing button does not have any effect.
I am very beginner to ad system and can’t find what is wrong, would appreciate any help