We have an app that changes its orientation depending on certain parts of the game, we noticed that when after changing the resolution, ads wont display.
this is the error we got
2016-05-06 04:00:04.239 game[4343:1035365] Warning: Attempt to present <UnityAdsMainViewController: 0x1582db050> on <UnityDefaultViewController: 0x15817cd60> whose view is not in the window hierarchy!
really would appreciate the help.
were using version 5.2.2 and the ads found in services
I’m getting the same error. I don’t change the orientation, but I do load the game in a landscape orientation.
The code for showing ads in my game is very simple,
public void ShowAd()
{
print (“SHOW AD”);
if (Advertisement.IsReady())
{
print (“SHOWING AD”);
Advertisement.Show();
}
}
}
gets called every X deaths. The ads display fine in the editor.
I have the same warning, and still am waiting for some answers from Unity…
I change orientations in code, but either way, it doesn’t display ads. iOS only error.
Edit: I was able to display ads as soon as I removed the screen.orientation code.
1 Like
This issue has been brought to the attention of the developers.
It only affects iOS and occurs when you change screen orientation from code.
It will be addressed in a future release, but for the time being - avoid changing screen orientation from the code.
Apologies for any inconvenience caused by this.
1 Like
Found that I was indeed changing the orientation via code as well as the settings, removed that and ads are working as expected. Thanks.
1 Like