googleads-consent-sdk-ios icon indicating copy to clipboard operation
googleads-consent-sdk-ios copied to clipboard

Response error. Publisher identifiers not found "ca-app-" Appended

Open sensoarltd opened this issue 6 years ago • 2 comments

I have an empty view controller project in iOS/Swift, after viewDidLoad() I have the following but get the error: Error Domain=Consent Code=1 "Response error. Publisher identifiers not found: ca-app-pub-MYID"

Obs. I have my own ID and admobID inserted. Can't seem to find why/where 'ca-pub-' is prepended? And if this is whats causing the error???

        PACConsentInformation.sharedInstance.consentStatus = PACConsentStatus.unknown
        PACConsentInformation.sharedInstance.requestConsentInfoUpdate(forPublisherIdentifiers: ["pub-MYID"]){
        
        (_ error: Error?) -> Void in
        if let error = error {
            // Consent info update failed.
            print(error)
        } else {
            // Consent info update succeeded. The shared PACConsentInformation instance has been updated.
            if PACConsentInformation.sharedInstance.consentStatus == PACConsentStatus.unknown {
                
                guard let privacyUrl = URL(string: "MYURL"),
                    let form = PACConsentForm(applicationPrivacyPolicyURL: privacyUrl) else {
                        print("incorrect privacy URL.")
                        return
                }
                form.shouldOfferPersonalizedAds = true
                form.shouldOfferNonPersonalizedAds = true
                form.shouldOfferAdFree = true
                
                form.load {(_ error: Error?) -> Void in
                    print("Load complete.")
                    if let error = error {
                        // Handle error.
                        print("Error loading form: \(error.localizedDescription)")
                    } else {
                        
                        form.present(from: self) { (error, userPrefersAdFree) in
                            
                            if error != nil {
                                // Handle error.
                            } else if userPrefersAdFree {
                                // User prefers to use a paid version of the app.
                                
                                
                                //buy the pro Version
                            }
                        }
                    }
                }
            }
        }
    }

sensoarltd avatar Jan 10 '19 16:01 sensoarltd

This module calls an API, that looks like this:

https://adservice.google.com/getconfig/pubvendors?es=2&plat=ios&v=1.0.5&pubs=pub-XXXXXXXXX

You can insert your pub id to try it out. As you can see from the response the ca-app appendix is added automatically, in that terms, there is nothing going wrong.

I have zero knowledge about the google ad service, just reconstructed that from the source code as I get the same error as you. Still investigating.

hannojg avatar Dec 28 '21 13:12 hannojg

It seems that in admob under Privacy & messaging you have to activate this consent collection.

Screenshot 2021-12-28 at 2 33 46 PM

// EDIT: I added a consent form in admob, but I still get the same error. Hm. // EDIT 2: Okay, it seems that our admob account is just not verified yet. Will try again once verified.

hannojg avatar Dec 28 '21 13:12 hannojg