Hi Colin - thanks a lot for posting. I figured out a suboptimal solution that I’ve posted below. Vlad posted back in 2021 about consent: Future of ad plugins - #5 by agramonte
All plugins updated after September I put ATT in them. You don’t need ATT plugin for most of the plugins anymore, since it is built in and would ask consent when network.init() is called.
It seems to me that admob.init() where I show the GDPR popup is ‘stomping’ on the ATT popup. I can delay the call to admob.init() and use att.request() but I really don’t want to display ATT before GDPR as there’s a fair few posts on various forums about Apple rejecting.
Here’s how I show GDPR after ATT. It needs refinement. Pitty that I can’t detect when GDPR closes - eek!
if event.phase == "init" then
print("********************************")
print("Loading AdMob Rewarded")
print("Loading AdMob Interstitial")
print("Loading AdMob Banner")
print("********************************")
admob.load("rewardedVideo", {adUnitId = adMobRewardedID})
admob.load("interstitial", {adUnitId = adMobInterstitialID})
admob.load("banner", {adUnitId = adMobBannerID})
admob.updateConsentForm({underage = false})
end
if event.phase == "refreshed" and event.type == "ump" then
local formStatus, consentStatus = admob.getConsentFormStatus()
print("formStatus: " .. tostring(formStatus) .. ", consentStatus: " .. tostring(consentStatus))
if formStatus == "available" and consentStatus == "required" then
admob.loadConsentForm()
end
end
if event.phase == "loaded" and event.type == "ump" then
admob.showConsentForm()
local function ShowATTPrompt()
local formStatus, consentStatus = admob.getConsentFormStatus()
if att.status == "notDetermined" and consentStatus == "obtained" then
att.request()
end
end
timer.performWithDelay(2000, ShowATTPrompt, 10)
end
if event.phase == "hidden" and event.type == "ump" then
-- This event does not fire in response to GDPR closure.
end
I’ll need to experiment with the timer. It’s a crude solution to getting ATT to show after GDPR!