3

Im currently implementing Admob into my iOS app. You can see the implementation under. While implementing a had a few question and after a lot of searching and documentation reading i still didn't have the answers. So here are my questions

  1. Should i show the ATT prompt fist then the GDPR form or should it be the other way around? Dose this matter?
  2. If a user consent to the ATT prompt and then don't consent to the GRDB form, how do i know not to serve personalised ads? 'UMPConsentInformation.sharedInstance.consentStatus' only returns status = obtained. It doesn't give me any information if the user consented to personalised ads or not.

I want to serve personalised ads if possible, otherwise i want to serve non personalised ads.

func requestIDFA() {
    ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
        requestLatestConsentForm()
    })
}

func requestLatestConsentForm() {
    let parameters = UMPRequestParameters()
    
    UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(
        with: parameters,
        completionHandler: { error in
            if error != nil {
                // Handle the error.
            } else {
                if UMPConsentInformation.sharedInstance.formStatus == UMPFormStatus.available {
                    self.loadForm()
                }
            }
        })
}

func loadForm() {
    UMPConsentForm.load(completionHandler: { form, loadError in
        if loadError != nil {
            // Handle the error.
        } else {
            let status = UMPConsentInformation.sharedInstance.consentStatus
            if status == UMPConsentStatus.required {
                form?.present(
                    from: UIApplication.shared.windows.first!.rootViewController! as UIViewController,
                    completionHandler: { dismissError in
                        if UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatus.obtained {
                            GADMobileAds.sharedInstance().start(completionHandler: nil)
                        }
                    })
            } else {
                // Keep the form available for changes to user consent.
            }
        }
    })
}
swiftdev4585
  • 115
  • 1
  • delay app measurement till consent is received from user https://developers.google.com/admob/ump/ios/quick-start#delay_app_measurement_optional – Amod Gokhale Sep 16 '22 at 06:20
  • I have added that, but how do i know if the user have consented to personalised ads or not? – swiftdev4585 Sep 16 '22 at 13:25
  • If a user consent to the ATT prompt and then don't consent to the GRDB form, how do i know not to serve personalised ads? – swiftdev4585 Sep 18 '22 at 20:13
  • with older version of you can fwd the consent based on consent status - https://developers.google.com/admob/ump/ios/quick-start#forward-consent . With my understanding with new form you don't get a simple yes/no.. its bit complicated and sdk will take care of deciding the which ads to show? However i don't find any official documentation supporting this theory. I would recommend to reach out to google admob group and post a question there.. only they can confirm this. – Amod Gokhale Sep 19 '22 at 05:49

0 Answers0