I tested for quite a long time until the consent was displayed and then the ads were displayed.
Check if you really have consentStatus == “obtained” and formStatus == “available” , because in my code only then ads are displayed.
To check the statuses, I used the code below, cut from some other application
local _, admob = pcall(require, “plugin.admob”)
local interstitialAppID = “ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx” --for your ANDROID interstitial
– AdMob listener function
local function adListener( event )
if ( event.phase == “init” ) then – Successful initialization
– Load an AdMob interstitial ad
admob.load( “interstitial”, { adUnitId=“ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx” } )
end
if event.phase == "closed" then
if event.type == "interstitial" then
admob.load( "interstitial", { adUnitId="ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx"} )
end
end
end
– Initialize the AdMob plugin
– Sometime later, show the interstitial ad
–admob.init( adListener, { appId=“ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx” } )
– pokaż formularz
– Set UMP Form for debug
–admob.updateConsentForm ({ underage=false ,debug= { geography = “EEA”} })
admob.updateConsentForm ({ underage=false })
–local function adListener( event )
– if ( event.phase == “init” ) then – Successful initialization
local formStatus, consentStatus = admob.getConsentFormStatus()
if consentStatus == "required" and formStatus == "available" then
admob.loadConsentForm()
end
-- end
admob.init( adListener, { appId=“ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx” } )
– if(event.phase == “loaded” and event.type == “ump”)then
if consentStatus == “required” and formStatus == “available” then
admob.showConsentForm()
end
–end
local subTitle = display.newText {
text = “plugin for Corona SDK”,
font = display.systemFont,
fontSize = 14
}
subTitle:setTextColor( 0.2, 0.2, 0.2 )
eventDataTextBox = native.newTextBox( 250, 500, 500, 300)
eventDataTextBox.placeholder = “Event data will appear here”
eventDataTextBox.hasBackground = true
local processEventTable = function(event)
local logString = json.prettify(event):gsub("\","")
logString = “\nPHASE: “…event.phase…” - - - - - - - - - \n” … logString
print(logString)
eventDataTextBox.text = logString … eventDataTextBox.text
end
local formLabel = display.newText {
text = “F O R M”,
font = display.systemFontBold,
fontSize = 38,
}
formLabel:setTextColor(1)
local loadFormButton = widget.newButton {
label = “Load Form”,
font = display.systemFontBold,
fontSize = 34,
width = 100,
height = 40,
labelColor = { default={ 255, 255, 255 }, over={ 0.7, 0.7, 0.7 } },
onRelease = function(event)
admob.loadConsentForm()
end
}
local showFormButton = widget.newButton {
label = “Show Form”,
fontSize = 34,
font = display.systemFontBold,
width = 100,
height = 40,
labelColor = { default={ 255, 255, 255 }, over={ 0.7, 0.7, 0.7 } },
onRelease = function(event)
admob.showConsentForm()
end
}
local getStatusFormButton = widget.newButton {
label = “Print Consent Status”,
fontSize = 34,
font = display.systemFontBold,
width = 100,
height = 40,
labelColor = { default={ 255, 255, 255 }, over={ 0.7, 0.7, 0.7 } },
onRelease = function(event)
local formStatus, consentStatus = admob.getConsentFormStatus()
logString = “\nForm Status: - - - - - - - - - \n” … "Form Status: “… formStatus …” Consent Status: "…consentStatus
eventDataTextBox.text = logString … eventDataTextBox.text
end
}
formLabel.x, formLabel.y = display.contentCenterX - 80, 60
loadFormButton.x, loadFormButton.y = display.contentCenterX - 130, 850
showFormButton.x, showFormButton.y = display.contentCenterX + 110, 850
getStatusFormButton.x, getStatusFormButton.y = display.contentCenterX - 80, -10