为什么我的Google AdMob GDPR同意书没有显示在我的iOS应用程序中

7d7tgy0s  于 5个月前  发布在  iOS
关注(0)|答案(2)|浏览(106)

我正在将UMP SDK实施到我的iOS应用程序中。我已在Google AdMob控制面板的隐私和消息部分设置了GDPR和IDFA消息。我在显示GDPR消息时遇到了问题。IDFA和iOS的ATT消息工作正常。
下面是我使用的代码.我已经测试了这两个模拟器和物理设备.此外,我位于欧盟.

static func trackingConsentFlow(completion: @escaping () -> Void) {
    let umpParams = UMPRequestParameters()
    let debugSettings = UMPDebugSettings()
    debugSettings.geography = UMPDebugGeography.EEA
    umpParams.debugSettings = debugSettings
    umpParams.tagForUnderAgeOfConsent = false
    
    UMPConsentInformation
        .sharedInstance
        .requestConsentInfoUpdate(with: umpParams,
                                  completionHandler: { error in
            if error != nil {
                print("MYERROR #1 \(String(describing: error))")
                completion()
            } else {
                let formStatus = UMPConsentInformation.sharedInstance.formStatus
                print("FORM STATUS: \(formStatus)")
                
                if formStatus == .available {
                    loadForm(completion)
                } else {
                    completion()
                }
            }
    })
}

private static func loadForm(_ completion: @escaping () -> Void) {
    UMPConsentForm.load(completionHandler: { form, loadError in
        if loadError != nil {
            print("MYERROR #2 \(String(describing: loadError))")
            completion()
        } else {
            print("CONSENT STATUS: \(UMPConsentInformation.sharedInstance.consentStatus)")
            if UMPConsentInformation
                .sharedInstance.consentStatus == .required {
                
                guard let rootViewController = UIApplication.shared.currentUIWindow()?.rootViewController else {
                    return completion()
                }
                
                form?.present(from: rootViewController, completionHandler: { dismissError in
                    if UMPConsentInformation
                        .sharedInstance.consentStatus == .obtained {
                        completion()
                    }
                })
            }
        }
    })
}

字符串
先说清楚
通过此代码,我可以显示IDFA消息,然后显示AppTrackingTransparency警报。但我希望还能看到GDPR同意书。

b1payxdu

b1payxdu1#

对于任何人想知道同样的事情。GDPR消息没有出现,因为我还没有完成我的Admob帐户设置。我还没有添加我的支付方式。添加它(并发送应用程序在Admob中进行审查)后,GDPR消息开始出现。

wb1gzix0

wb1gzix02#

如果您正在进行初始集成,并且在XCode调试时无法显示它,则可以通过在调试日志中查找以下字符串来启用调试模式:

<UMP SDK> To enable debug mode for this device, set: UMPDebugSettings.testDeviceIdentifiers = @[ @"SOME-ID-VALUE" ];

字符串
取这个值,在上面引用的Swift代码中,设置:

debugSettings.testDeviceIdentifiers = ["SOME-ID-VALUE"]


考虑到你已经有了IFDA对话框显示,这可能不是你的具体问题,但对于其他人通过谷歌搜索来到这里,上述可能是信息。

相关问题