Appodeal refresh loop

Hi, I have a problem with Appodeal.

In the main.lua: 

local appodeal = require( "plugin.appodeal" ) local function adListener(event)     if (event.phase=="init") then         print("Appodeal event: initialization successful")         appodeal.show( "banner", { yAlign="bottom" } )     elseif (event.phase=="loaded") then         print("Appodeal event: "..tostring(event.type).." ad loaded successfully")     elseif (event.phase=="closed") then         print("Appodeal event: "..tostring(event.type).." ad closed by user")     elseif (event.phase=="clicked") then         print("Appodeal event: "..tostring(event.type).." ad clicked/tapped by user")     elseif (event.phase=="failed") then         print("Appodeal event: "..tostring(event.type).." ad failed to load")     end end appodeal.init( adListener, { appKey="KEY"})

The problem is that the adlistener keeps running in the background and keeps calling the show function every few seconds.

What should i do? I got so many impressions just from testing my game.

Are you calling appodeal.init() multiple times?

Rob

Phase ‘init’ only gets called once, so I don’t understand why you would see it called every few seconds.

However, you should not try to call show() after phase ‘init’, as there is no guarantee that an ad is available at that point in time. You should only call show() after an ad has been loaded. When a banner has been loaded an event with phase ‘loaded’ and type ‘banner’ will be sent to the listener.

Well I made a newbie mistake. it’s not the init() that gets called every time but the load() because autoCacheAds was set to true by default.

However I set autoCacheAds to false because the refresh creates lag (low fps) and makes the game unplayable.

But even when autoCacheAds is false I have low fps with most ads.

FYI, I moved the show() call to the loaded phase and checked if it is a banner and the issue persists.

what should I do about the low fps issue?

It’s recommended to leave autoCacheAds on by default as otherwise you’ll need to add your own code to make sure ads are loaded at all times.

If you are referring to banner ads affecting fps, then that has been a known issue for a long time (several years) with all ad providers that support banner ads, not only Appodeal. For example, AdMob recommends not to display banner ads during game play. Animated banners will affect fps and there’s not much that can be done about it. It’s best to show banner ads on static pages like a Game Over scene where there are minimal animations not crucial for game play.

I developed a game in Xcode for iPhone and iPad and used AdMob for all gameplay scenes without even one frame drop.

So I guess it’s either a corona issue or an android issue.

Anyhow thanks for the help.

Are you calling appodeal.init() multiple times?

Rob

Phase ‘init’ only gets called once, so I don’t understand why you would see it called every few seconds.

However, you should not try to call show() after phase ‘init’, as there is no guarantee that an ad is available at that point in time. You should only call show() after an ad has been loaded. When a banner has been loaded an event with phase ‘loaded’ and type ‘banner’ will be sent to the listener.

Well I made a newbie mistake. it’s not the init() that gets called every time but the load() because autoCacheAds was set to true by default.

However I set autoCacheAds to false because the refresh creates lag (low fps) and makes the game unplayable.

But even when autoCacheAds is false I have low fps with most ads.

FYI, I moved the show() call to the loaded phase and checked if it is a banner and the issue persists.

what should I do about the low fps issue?

It’s recommended to leave autoCacheAds on by default as otherwise you’ll need to add your own code to make sure ads are loaded at all times.

If you are referring to banner ads affecting fps, then that has been a known issue for a long time (several years) with all ad providers that support banner ads, not only Appodeal. For example, AdMob recommends not to display banner ads during game play. Animated banners will affect fps and there’s not much that can be done about it. It’s best to show banner ads on static pages like a Game Over scene where there are minimal animations not crucial for game play.

I developed a game in Xcode for iPhone and iPad and used AdMob for all gameplay scenes without even one frame drop.

So I guess it’s either a corona issue or an android issue.

Anyhow thanks for the help.