Google consent SDK(谷歌同意 SDK)
问题描述
我尝试使用 Google ConsentSDK 在 Android 应用同意表单中显示.当我调用 form.show() 时,我收到此错误:同意书错误同意书尚未准备好显示."谁能帮帮我?
I try to use Google ConsentSDK to show in Android app consent form. When I call form.show() I get this error: "Consent form error Consent form is not ready to be displayed." Who can help me?
我的代码:
推荐答案
这是我在应用中使用的 Google Consent SDK 的帮助程序类.为了初始化同意信息并在需要时显示同意书,我在主要活动的 onCreate()
方法中有以下代码:
Here is my helper class for the Google Consent SDK that I use in my app. To initialise the consent information and display the Consent Form if needed, I have following code in onCreate()
method of my main activity:
同样,当用户点击偏好设置中的重置我的隐私许可"时,我会运行以下代码:
Similarly, I run following code when user clicks on "Reset my privacy consent" in preferences:
这两次都是引用当前正在运行的活动.
where both times, this is referencing current running activity.
帮助类的完整实现:
Full implementation of the helper class:
这篇关于谷歌同意 SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!