Vungle interstitial plugin ad not possible with "applicationResume" ?

Hi, Im trying to add an event listener for “applicationResume” to play vungle ads, but vungle ads always trigger a “applicationStart”, “applicationSuspend” and a “applicationResume” event so for obvious reasons this creates an endless loop as long theres is an ad to show. It doesn’t mater if I use “adEnd”. A workaround is to have a playAd = true tag, and then setting that to false when the ad has played on applicationStart. And then creating a new event listener for the background that sets playAd = true when the user has started to use the app wich is fine as thats the way its supposed to be. But Is there something wrong with my logic here or is It supposed to behave like this?

This only happens on Android. It happens with all ad networks on and Android device (like AdMob / Chartboost etc). Every time an ad is shown Android suspends the app and later resumes when closing the ad. 

applicationStart is only fired once though when your app is launched, so you can’t rely on setting playAd=false there. This is a bit tricky on Android, but one workaround would be to save the time in a variable during applicationSuspend ( os.time() ) and in applicationResume check that variable with the current time (os.time() again) to determine how many seconds has passed. If less than (x) seconds has passed it means that the user is likely resuming from an ad. If more than (x) seconds has passed you show a new ad.

iOS does not suspend/resume while showing ads.

Nice, thank you =)) Will try it out when my I want to throw my android out of the window temper has calmed down :smiley: One other question,  sometimes on Android when the app is suspended and resumed to a add It fails to load som of the scene, but not all of it. Its happens randomly and theres nothing in logical about It. But only on ads, if I remove ads and apps is resumed from suspended Is never happens. This happen to me on all android 4.x.x versions. Have you seen this happen?

I’ve seen many strange things happen on Android… All I can say is that Android is a moody beast of an OS.

:) One again, thanks for the tip

This only happens on Android. It happens with all ad networks on and Android device (like AdMob / Chartboost etc). Every time an ad is shown Android suspends the app and later resumes when closing the ad. 

applicationStart is only fired once though when your app is launched, so you can’t rely on setting playAd=false there. This is a bit tricky on Android, but one workaround would be to save the time in a variable during applicationSuspend ( os.time() ) and in applicationResume check that variable with the current time (os.time() again) to determine how many seconds has passed. If less than (x) seconds has passed it means that the user is likely resuming from an ad. If more than (x) seconds has passed you show a new ad.

iOS does not suspend/resume while showing ads.

Nice, thank you =)) Will try it out when my I want to throw my android out of the window temper has calmed down :smiley: One other question,  sometimes on Android when the app is suspended and resumed to a add It fails to load som of the scene, but not all of it. Its happens randomly and theres nothing in logical about It. But only on ads, if I remove ads and apps is resumed from suspended Is never happens. This happen to me on all android 4.x.x versions. Have you seen this happen?

I’ve seen many strange things happen on Android… All I can say is that Android is a moody beast of an OS.

:) One again, thanks for the tip