Hi - my app is a flashcard app. It has a main menu from which you can choose a topic module to work on. My aim is to show an interstitial ad each time the user goes back to the main menu from a module, or after having answered 10 flashcard questions. My app code lives in several files (a main.lua, and one .lua file per module) but I have a common data file containing functions and tables that are used by all modules. I put my admob calling code in the common data file. It looks like this:
c.showAnAd = function() local function adListener( event ) local json = require( "json" ) print( json.prettify( event ) ) if ( event.phase == "init" ) then -- Successful initialization admob.load("interstitial",{adUnitId="XXXXX", childSafe = true }) end end admob.init( adListener, {appId="XXXXX" } ) if ( admob.isLoaded( "interstitial" ) ) then admob.show( "interstitial" ) end end
I published the app on the google play store. When I run the app, I’m expecting to see an ad each time I go to the main menu (the code for the menu calls the function above every time the menu appears). What happens is I seem to see an occasional ad at random times, and only about 1 ad for every 20 times I go to the menu.
I have tried to tether my Android phone to my Macbook and chose “copy to device and launch” so I can view the console output. But I get the following error message when I try to install the app on the phone.
I also get this in the console:
Error running /Applications/Corona/Corona Simulator.app/Contents/Resources/android\_sendapp.sh ( "-r", "/Users/davidp/Desktop/Mini Music Theory School.apk"
Android version is 5.1. Corona is 2018.3326
I’m not sure if this was the right forum to post this so feel free to move it elsewhere. Thanks.