使用UserMessagingPlatform无法展示GDPR同意表单,求助解决
问题:GDPR同意消息无法正常显示
我按照Google AdMob安卓隐私指南实现GDPR同意消息展示,但始终无法成功显示。参考文档中隐私选项部分的代码并修改后,最终代码如下:
consentInformation = UserMessagingPlatform.getConsentInformation(this); consentInformation.requestConsentInfoUpdate( this, params, (ConsentInformation.OnConsentInfoUpdateSuccessListener) () -> { UserMessagingPlatform.loadAndShowConsentFormIfRequired( this, (ConsentForm.OnConsentFormDismissedListener) loadAndShowError -> { // ... // Consent has been gathered. if (isPrivacyOptionsRequired()) { // Regenerate the options menu to include a privacy setting. ConsentVisibility = true; } else ConsentVisibility = false; } ); }, (ConsentInformation.OnConsentInfoUpdateFailureListener) requestConsentError -> { // Consent gathering failed. Log.d("ConsentF", String.format("%s: %s", requestConsentError.getErrorCode(), requestConsentError.getMessage())); });
我已尝试以下操作:
- 使用测试选项测试
- 不使用测试选项测试
- 在模拟器和实体设备上测试
- 关闭广告拦截器
无论进行何种操作,同意表单都无法显示。
补充说明:已在Google控制台中添加同意表单。
内容的提问来源于stack exchange,提问作者kriki200
相关产品推荐
相关产品推荐

