出于某种原因,当我尝试加载 GDPR 同意书时,我不断收到错误消息:
错误:应用名称无效。
它发生在这里:
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
}
当我进行全局搜索时,invalid app name
我会被带到consentform.html
文件中:
// Set app name.
var appName = formInfo['app_name'] || '';
if (appName.length <= 0) {
formLoadCompleted('Error: invalid app name.');
}
这告诉了来自 thegoogleservice-plist
或 myinfo.plist
或其他东西的一些值没有被正确读取,但我不知道要查看哪个值。
在我的里面我info.plist
有GADApplicationIdentifier
正确的设置:
为什么我的应用程序的名称显示为 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
}
}