For some reason when I try to load the GDPR Consent form I keep getting the error:
Error: invalid app name.
It happens here :
form.load { [weak self](_ error: Error?) -> Void in
print("Load complete.")
if let error = error {
// *** HERE IS THE ERROR ***
print("Error loading form: \(error.localizedDescription)")
return
}
When I do a global search for invalid app name
I get brought to the consentform.html
file:
// Set app name.
var appName = formInfo['app_name'] || '';
if (appName.length <= 0) {
formLoadCompleted('Error: invalid app name.');
}
This tells some value from either the googleservice-plist
or my info.plist
or something else isn't being read correctly but I don't know which value to look at.
Inside my info.plist
I have the GADApplicationIdentifier
correctly set:
Why is my app's name coming up as nil?
PACConsentInformation.sharedInstance.debugGeography = .EEA
PACConsentInformation
.sharedInstance
.requestConsentInfoUpdate(forPublisherIdentifiers: ["pub-MY_PublisherID"]) { [weak self](error) in
if let error = error { return }
PACConsentInformation.sharedInstance.isRequestLocationInEEAOrUnknown {
if PACConsentInformation.sharedInstance.consentStatus == PACConsentStatus.unknown {
guard let privacyUrl = URL(string: "My_Privacy_URL"),
let form = PACConsentForm(applicationPrivacyPolicyURL: privacyUrl) else {
return
}
form.shouldOfferPersonalizedAds = true
form.shouldOfferNonPersonalizedAds = true
form.shouldOfferAdFree = true
form.load { [weak self](_ error: Error?) -> Void in
print("Load complete.")
if let error = error {
// *** HERE IS THE ERROR ***
print("Error loading form: \(error.localizedDescription)")
return
}
// ...
}
return
}
}