Admob Android adverts not displaying at game initlize but appear OK after

hairyfingers

  • *
  • Posts: 110
Hi

I am running the Robinschaafsma Admob extension.  I initialize the ads in a "When Created" event for my first scene.  The advert does not show.  If I play the game and die the game resets back to this first scene and the advert now displays fine.

Is there any reason why it does not show straight away upon creation? I have included an IF block to check if the banner has loaded correctly and it does not trigger suggesting that the ads have initialized fine.  In fact if I turn of my network thereby disallowing the ads to initialize then the IF block does trigger.  So the game must think the Ads have initialized

I have tried adding 'Show Ad' blocks all over the place - Always, Creating,  on actors and scenes. but nothing happens.  I have to play the game and then the adverts show up when the scene reloads.

This is on both a nexus 5 Android 5.1 and a Nexus 7 android 4.4.4.

any ideas?

robinschaafsma

  • *
  • Posts: 712
Can you created a screen shot of your code, so i can see what you are doing?

hairyfingers

  • *
  • Posts: 110
Hi

OK so in the default scene after the game loads I have the blocks attached called 'snippetcode' in a When Created event

Also as an 'Always' event in that same scene I have snippetcode1  to check if adverts have initialized.  If not then the scene transitions to another scene saying you can't play until adverts can be displayed.  If I put my phone in airplane mode then this block triggers and shows the requested scene.  I have wifi or phone data on then this block doesn't trigger - suggesting that the
adverts are indeed ready to go.

again on that default scene I have an actor that can be clicked to access a help scene.  On this help scene I have snippetcode2 in a When Created event.  The advert displays immediately and when I exit this scene back to the default scene the advert continues to display at the same position .



robinschaafsma

  • *
  • Posts: 712

- The Init block can only be called once per user session in When created Event (like in a loading scene, this scene is only loading once per user session).
- In the same loading scene you can use in  succesfully load and faild to load blocks in a If statement. and do you thing

hairyfingers

  • *
  • Posts: 110
I've come up with a solution.

I've changed the opening scene to be a blank scene.  I've put a single When Created event to initialize the Ads then use a When Updating with an IF block to move to the main game scene when the ad banners are initialised.  When the scene transitions I use a show ad banner block and the ad shows up straight away.  So in some ways this is better because it won't start the game until a network is detected that can load adverts.

thanks for your inputs
cheers