Ads Won't Show After One Restart

Heys guys, I’m struggling with a weird Inmobi Ads problem here. (only happens in Android)

 

The first time I run my game, the ads will show as intended, but after I close it using the cell phone’s back button and try to reopen it, the ads won’t ever show. Once I close it and “Force interrupt” the process in the phone’s configuration, and then reopen, the ads start working again.

 

I have absolutely no idea what might be causing it and any tips are welcome :slight_smile:

 

Thanks!

Sometimes an ad is not always returned by the ad network.  Unfortunately, that is normal.  Typically this is due to them running out of “inventory” at the time/region you are in… as in they ran out of ads.  I’ve noticed in the past that InMobi used to have far more inventory for iOS than Android.  Not sure if that’s still true.  Just an observation.

We do have an ad listener that allows your code to detect when InMobi or inneractive fails to receive an ad.  Our sample project “Ads/inneractive” demonstrates how to set up this listener.  InMobi supports this Lua listener as well, even though its sample project does not show an example of it.

Hey Joshua

The ad is set to use testMode=true…

So I believe this can’t be the reason this is happening, can it?

Thanks…

The “testMode” setting is supposed to give you “InMobi” test ad banners, but those ads still come from InMobi’s web servers and they sometimes fail to get delivered to me as well.  That is, these test ad banners are not embedded in InMobi’s library.  Unfortunately, there is nothing we can do about this on our end.  Sometimes ads are fail to get delivered.

Also, it wouldn’t hurt to contact InMobi about this too.  I know in the past that sometimes the issue was that a developer’s InMobi account was not fully “activated” and it involved talking to their tech-support team to help expedite activation.

Ok, no problem then.

Thanks, Joshua

Sometimes an ad is not always returned by the ad network.  Unfortunately, that is normal.  Typically this is due to them running out of “inventory” at the time/region you are in… as in they ran out of ads.  I’ve noticed in the past that InMobi used to have far more inventory for iOS than Android.  Not sure if that’s still true.  Just an observation.

We do have an ad listener that allows your code to detect when InMobi or inneractive fails to receive an ad.  Our sample project “Ads/inneractive” demonstrates how to set up this listener.  InMobi supports this Lua listener as well, even though its sample project does not show an example of it.

Hey Joshua

The ad is set to use testMode=true…

So I believe this can’t be the reason this is happening, can it?

Thanks…

The “testMode” setting is supposed to give you “InMobi” test ad banners, but those ads still come from InMobi’s web servers and they sometimes fail to get delivered to me as well.  That is, these test ad banners are not embedded in InMobi’s library.  Unfortunately, there is nothing we can do about this on our end.  Sometimes ads are fail to get delivered.

Also, it wouldn’t hurt to contact InMobi about this too.  I know in the past that sometimes the issue was that a developer’s InMobi account was not fully “activated” and it involved talking to their tech-support team to help expedite activation.

Ok, no problem then.

Thanks, Joshua

Same thing happening here. After closing the app, no ads. I have to go into the phone’s ram settings and clear the memory for the ads to kick in again. Similar if I call a webview with no connection to the internet, when I switch data back on it doesn’t connect until I clear the phone memory. This on a Samsung GS2.

CraftyDeano has helped me with this. You need to catch the back button and initiate os.exit() instead of the usual native.requestExit(). This successfully allows my app to call ads on restarts every time, so it looks like Corona isn’t currently handling the default Android back button activity quite correctly.

Only drawback with calling os.exit is that it takes around eight seconds to exit.

Hope this helps you @guilovsh

I highly recommend that you do *not* call os.exit().  That force quits the application process in a not-so-nice way (think Ctrl+Alt+Del) that may be interpreted as a crash by app reviewers.  The other side effect is that force quitting the application process will also remove all notifications belonging to your app in the status bar.

The native.requestExit() function exits out of the activity window, but does not terminate the application process.  This is normal behavior on Android.  In fact, look at how other Android apps handle this as well.  When you back out of an app such as the Web Browser or Angry Birds, notice that their application processes are still alive when you go to the device’s Applications list under Settings.

We document this here…

http://docs.coronalabs.com/api/library/native/requestExit.html

http://docs.coronalabs.com/api/library/os/exit.html

Regarding InMobi ads never showing upon 2nd launch of the app, I’ve discovered that it is a bug with our last release version.  It is not an issue with our last release version, build #971.  It is also only an issue with InMobi.  This issue does not happen with inneractive ads.  We’ll look into fixing this issue in a daily build in the near future.

The InMobi issue has been fixed.  This fix will be made available in daily build #1083.

Thank you for reporting this issue.

Same thing happening here. After closing the app, no ads. I have to go into the phone’s ram settings and clear the memory for the ads to kick in again. Similar if I call a webview with no connection to the internet, when I switch data back on it doesn’t connect until I clear the phone memory. This on a Samsung GS2.

CraftyDeano has helped me with this. You need to catch the back button and initiate os.exit() instead of the usual native.requestExit(). This successfully allows my app to call ads on restarts every time, so it looks like Corona isn’t currently handling the default Android back button activity quite correctly.

Only drawback with calling os.exit is that it takes around eight seconds to exit.

Hope this helps you @guilovsh

I highly recommend that you do *not* call os.exit().  That force quits the application process in a not-so-nice way (think Ctrl+Alt+Del) that may be interpreted as a crash by app reviewers.  The other side effect is that force quitting the application process will also remove all notifications belonging to your app in the status bar.

The native.requestExit() function exits out of the activity window, but does not terminate the application process.  This is normal behavior on Android.  In fact, look at how other Android apps handle this as well.  When you back out of an app such as the Web Browser or Angry Birds, notice that their application processes are still alive when you go to the device’s Applications list under Settings.

We document this here…

http://docs.coronalabs.com/api/library/native/requestExit.html

http://docs.coronalabs.com/api/library/os/exit.html

Regarding InMobi ads never showing upon 2nd launch of the app, I’ve discovered that it is a bug with our last release version.  It is not an issue with our last release version, build #971.  It is also only an issue with InMobi.  This issue does not happen with inneractive ads.  We’ll look into fixing this issue in a daily build in the near future.