Hello. In my iOS project, I load ads in multiple locations: Including AppDelegate (to pre-load Interstials, Banner Ad and App Open Ad). I also load ads (Rewarded and Interstitial) in several other View Controllers throughout the App.
It is my understanding that I must load the form BEFORE Ads load. So I will do this by adding the UMP consent form in AppDelegate didFinishLaunchingWithOptions. My code for this is below. I got this code from this video posted by AdMob on YouTube: https://www.youtube.com/watch?v=EwcrESnAYEI
func gdprJustin() {
let rootVC = self.window?.rootViewController as? UINavigationController
// Create a UMPRequestParameters object.
let parameters = UMPRequestParameters()
parameters.tagForUnderAgeOfConsent = false
// ============================
// ============================
// FOR DEBUG ONLY
let debugSettings = UMPDebugSettings()
debugSettings.testDeviceIdentifiers = [testiPhone]
debugSettings.geography = .EEA
parameters.debugSettings = debugSettings
// ============================
// ============================
// Call this on every app launch!
UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(with: parameters) {
[weak self] requestConsentError in
guard let self else {return}
if let error = requestConsentError {
print("ERROR! \(error.localizedDescription)")
}
UMPConsentForm.loadAndPresentIfRequired(from: rootVC!) {
[weak self] loadAndPresentError in
guard let self else { return }
if let error = loadAndPresentError {
print("ERROR! \(error.localizedDescription)")
}
// Consent gathering process has completed.
if UMPConsentInformation.sharedInstance.canRequestAds {
startMobileAds()
}
}
}
// Attempt to load ads using consent obtained in the previous session.
if UMPConsentInformation.sharedInstance.canRequestAds {
startMobileAds()
}
}
private func startMobileAds() {
DispatchQueue.main.async {
guard !self.isMobileAdsStartCalled else {return}
self.isMobileAdsStartCalled = true
GADMobileAds.sharedInstance().start()
}
}
My question is… is this proper UMP SDK integration? Do I still need to load the ads AFTER GADMobileAds.sharedInstance().start() in startMobileAds() ??? What about the SEVERAL other GADRequest() load calls I perform outside of AppDelegate?
Thank you for your help.
Hi Joe,
Thank you for contacting the Mobile Ads SDK support team.
I will check with our team regarding your query and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.
![]() |
Mobile Ads SDK Team |