Appodeal interstitials restart my app

Jambo!

I’m facing a weird issue with Appodeal ads. first, I was testing Appodeal banner and interstitials ads in testMode and everything worked perfectly. When turned off testMode a problem appeared when displaying an interstitial ad. Everytime I show the interstitial(between scenes) it force an exit request and restarts the app.

Device console log: 

systemEvent applicationSuspend 
I/Corona ( 8860): suspending… 
I/Corona ( 8860): interstitial displayed 
I/Corona ( 8860): systemEvent applicationExit

Again, when tested it before on testMode it worked just fine. changed nothing from that point but the testMode…

Help would be great!

Itay

Unfortunately I cannot reproduce your issue. When displaying an Interstitial with testMode=false the app suspends, and later resumes after the interstitial is closed.

Any idea what causes the exit request? It worked with another providers when positioned the interstitial at the same spot…

At the moment I can’t think of anything that could be causing the Exit request.

Which Android device and Android version do you see this on?

Am using Xiaomi Redmi Note 3

Android version 5.0.2 LRX22G

The suspension causing the exit request but there is nothing in my code that suppost to do that…

------HANDLE SYSTEM EVENTS------ local function onSystemEvent( event )   print( "systemEvent " .. event.type )   if ( event.type == "applicationSuspend" ) then     print( "suspending..........................." )   elseif ( event.type == "applicationResume" ) then     print( "resuming............................." )   elseif ( event.type == "applicationExit" ) then     loadsave.saveTable( myData.settings, "settings.json" );   elseif ( event.type == "applicationStart" ) then     gameNetworkSetup()  --login to the network here   end   return true end Runtime:addEventListener( "system", onSystemEvent )

Thanks,

Itay

Are you pressing the Android ‘back’ button or the (X) button on the ad to close the ad?

I’m starting to suspect if you use the ‘back’ button that some ad networks might not handle it and send the event to Corona which will then exit the app.

Nah… I’m pressing the ad with the (X) button on the ad. The exit request happens before I even close the ad…

I’m facing another issue… now with Appodeal rewardedVideo. first I’m getting test ads from Adcolony when testMode is false( not using Adcolony plugin with Appodeal ) and second the same weird “restart” happens when a rewardedVideo is hidden… exactly like the interstitial. 

If you recently registered the app, you may still get test ads from some ad networks even when testMode=false. It can take a while for Appodeal to register your app with the different ad networks. 

As for the “exit” problem, I still cannot reproduce it.

What other plugins are you using?

Thanks for the first answer!

Am using only Appodeal plugin as my ad provider.

build.settings:

    plugins =   {     ["CoronaProvider.gameNetwork.google"] =    {      publisherId = "com.coronalabs",    },         ["plugin.google.play.services"] =         {           publisherId = "com.coronalabs",           supportedPlatforms = { android=true }         },         ["plugin.appodeal"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },     },

Itay

I think it’s realy about my android device… When playing top rated games from the google play store when an interstitial or rewardedVideo ad shows, the game restarts. Any idea how can I fix this troubling issue…?

Itay 

Aha. So it looks like it’s not a plugin issue then. I have not seen this kind of behavior on any of my own Android devices. I have Samsung Galaxy and Google Nexus devices with Android versions from 2.3.6 up to 7.1 and all of them work as expected.

Unfortunately it looks like it’s an issue with that particular Xiaomi device. 

Fixed!!

If you have ever messed with the developer settings on your phone, then it is an option
called “do not keep activities” with the description “clear every activity as soon as the user leaves it”. The reason this happens is because as the description says, when you leave the app it closes it, and when the ad pops up, it thinks you left the app and closes it. If you haven’t messed with your developer settings, look up a tutorial on how to open them, then check to see if that option is enabled. I hope this helps

found that on the Android Central forums.

Thank god!

Great news :slight_smile:

Unfortunately I cannot reproduce your issue. When displaying an Interstitial with testMode=false the app suspends, and later resumes after the interstitial is closed.

Any idea what causes the exit request? It worked with another providers when positioned the interstitial at the same spot…

At the moment I can’t think of anything that could be causing the Exit request.

Which Android device and Android version do you see this on?

Am using Xiaomi Redmi Note 3

Android version 5.0.2 LRX22G

The suspension causing the exit request but there is nothing in my code that suppost to do that…

------HANDLE SYSTEM EVENTS------ local function onSystemEvent( event )   print( "systemEvent " .. event.type )   if ( event.type == "applicationSuspend" ) then     print( "suspending..........................." )   elseif ( event.type == "applicationResume" ) then     print( "resuming............................." )   elseif ( event.type == "applicationExit" ) then     loadsave.saveTable( myData.settings, "settings.json" );   elseif ( event.type == "applicationStart" ) then     gameNetworkSetup()  --login to the network here   end   return true end Runtime:addEventListener( "system", onSystemEvent )

Thanks,

Itay

Are you pressing the Android ‘back’ button or the (X) button on the ad to close the ad?

I’m starting to suspect if you use the ‘back’ button that some ad networks might not handle it and send the event to Corona which will then exit the app.

Nah… I’m pressing the ad with the (X) button on the ad. The exit request happens before I even close the ad…