No Ads Shown After Confirming Consent Choices (iOS Swift)

122 views
Skip to first unread message

Ayush Kandpal

unread,
Jan 2, 2024, 9:46:25 PM1/2/24
to Google Mobile Ads SDK Developers

Here's the problem:

  • Users who choose "Manage options" and then confirm their choices, are not seeing any ads displayed in the app.
  • This applies to both personalized and non-personalized ad settings.

Troubleshooting Steps:

I have already:

  • Implemented consent information handling using UMPConsentInformation.sharedInstance.
  • Checked for and set the npa=1 flag for non-personalized ad requests.
  • Verified consent form configuration and user choice confirmation.
  • Reviewed ad network settings (e.g., AdMob).
  • Cleaned the project build folder and rebuilt.




Current Status:

  • The issue persists even after implementing the suggested solutions.
  • I'm attaching relevant code snippets .

     let requestParameter = UMPRequestParameters()

        let debugSetting = UMPDebugSettings()

        debugSetting.geography = .EEA

        debugSetting.testDeviceIdentifiers = ["4902DF8E-CAD4-4EF1-B061-4607F4A2ACBF"//"64B1E738-5465-4AD6-91A5-993548592D7D"]

        requestParameter.debugSettings = debugSetting


        // Request an update for the consent information.

         UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(with: requestParameter) {

           [weak self] requestConsentError in

           guard let self else { return }


           if let consentError = requestConsentError {

             // Consent gathering failed.

             return print("Error: \(consentError.localizedDescription)")

           }

             

             UMPConsentForm.loadAndPresentIfRequired(from: self) {

                 [weak self] loadAndPresentError in

                 guard let self else { return }

                 

                 if let consentError = loadAndPresentError {

                     // Consent gathering failed.

                     return print("Error: \(consentError.localizedDescription)")

                 }

//                 else{

                 DispatchQueue.main.asyncAfter(deadline: .now() + 1.0){

                     if UMPConsentInformation.sharedInstance.canRequestAds{

                         self.startMobileSdk()

                     }

                     else{

                         self.loadNonPersonalizedAds()

                     }

                 }

             }


           // TODO: Load and present the consent form.

         }

//        DispatchQueue.main.asyncAfter(deadline: .now() + 4.0){

        if UMPConsentInformation.sharedInstance.consentStatus == .obtained {

            if UMPConsentInformation.sharedInstance.canRequestAds{

                self.startMobileSdk()

            }

            else{

                self.loadNonPersonalizedAds()

            }

        }


    private func loadNonPersonalizedAds() {

        DispatchQueue.main.async {

            // Configure the request for non-personalized ads

            let request = GADRequest()

            request.requestAgent = "PubCommonID=ForAdvertisingID/IDFA;is_lat=0"


            // Load the banner view with non-personalized ads

            self.bannerView.load(request)

        }

    }

    

    

    

    

    private func startMobileSdk(){

        DispatchQueue.main.async {

            guard !self .isMobileAdStartCalled else { return }

            self.isMobileAdStartCalled = true

            

//            let request: GADRequest = GADRequest()

//            self.bannerView.load(request)

            

            let request = GADRequest()

            let extras = GADExtras()

            extras.additionalParameters = ["tag_for_child_directed_treatment""false"]

            request.register(extras)




            self.bannerView.load(request)


            

            

        }

    }


Mobile Ads SDK Forum Advisor

unread,
Jan 2, 2024, 10:34:25 PM1/2/24
to iosay...@gmail.com, google-adm...@googlegroups.com
Hi Ayush Kandpal,

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. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02r50bQ:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Mobile Ads SDK Forum Advisor

unread,
Jan 3, 2024, 11:23:48 AM1/3/24
to iosay...@gmail.com, google-adm...@googlegroups.com
Hello Ayush,

Limited Ads serving applies if there is no consent for IAB TCF Purpose 1 in accordance with the EU user consent policy. Per the Limited Ads "Demand Eligibility" section, the initial offering in limited ads is currently just waterfall mediation, meaning no ads are returned from the AdMob network. However, programmatic limited ads will be available sometime in Q1 2024. See Ad serving modes for more information.

In addition to collecting purposes consent you also need to collect vendor consent. Both purposes consent and vendor consent are required for any vendor, such as Google, to serve appropriate ads.

Thanks,
Eric, Mobile Ads SDK Team

ref:!00D1U01174p.!5004Q02r50bQ:ref
Reply all
Reply to author
Forward
0 new messages