Riley Bruce
Riley Bruce

Reputation: 1

Why is admob consent form not loading on actual devices?

I am trying to implement Admob for my iOS app. The form loads on the Xcode simulator devices. I am located in the US, but I have used the following code to test that the Consent SDK is working for European users. When I use this with a simulator, the form and ads load.

PACConsentInformation.sharedInstance.debugIdentifiers = ["SPECIFIC_TO_MY_DEVICE"]
PACConsentInformation.sharedInstance.debugGeography = PACDebugGeography.EEA

The form does not load on my physical device with this configuration. The form also did not load when I used testflight to distribute a test version to a test user in the EU. Subsequently, the ads did not load on "European" devices.

When the form should load, I get an error from the below block of code. Also. I get the error WebKitDomain Error 101. My ATS settings are set up in the plist per the Admob documentation.

thisForm.load {(_ error: Error?) -> Void in
    if let error = error {
        print("Error loading form: \(error.localizedDescription)")
        //I am getting the error here.
    } else {
        thisForm.present(from: self) { (error, userPrefersAdFree) in
            print("in present handler")
            if let error = error {
                // Handle error.
                print("error presenting: \(error.localizedDescription)")
            } else if userPrefersAdFree {
                //TODO: find a way to disable ads
            } else {
                // Check the user's consent choice.
                //let status = PACConsentInformation.sharedInstance.consentStatus
            }
        }
    }

Does anyone know what may be causing these errors with physical devices? I have tried with a real ad id and a test ad id.

Upvotes: 0

Views: 630

Answers (1)

RS2307
RS2307

Reputation: 106

Present consent form only if the following equals true

If requestLocationInEEAOrUnknown == true {
//present consent form
}
else {
//do whatever is needed
}

Upvotes: 1

Related Questions