You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
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
}
}
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
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.
It seems that in admob under Privacy & messaging you have to activate this consent collection.
// 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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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???
The text was updated successfully, but these errors were encountered: