You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Kotlin中GDPR授权弹窗无法显示问题求助

Android Kotlin中GDPR授权弹窗无法显示问题求助

大家好,我最近碰到了个棘手的问题,想请各位帮忙分析下。

我写了一段加载GDPR授权表单的代码,运行后日志里只会打印出"show form",但授权弹窗就是弹不出来,后续的逻辑也完全没动静。

我的代码如下:

fun loadForm() {
    UserMessagingPlatform.loadConsentForm(
        this,
        {
            if (consentInformation.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) {
                Log.d("pikaboo", "show form")
                consentForm.show(
                    this,
                    ConsentForm.OnConsentFormDismissedListener {
                        if (consentInformation.consentStatus == ConsentInformation.ConsentStatus.OBTAINED) {
                            Log.d("pikaboo", "done, set ads")
                        } else {
                            Log.d("pikaboo", "dismiss")
                        }
                    }
                )
            }
        },
        {
            Log.d("pikaboo", "error")
        }
    )
}

补充下背景:我用AdMob都好几年了,一直能正常收到付款,账号也和AdSense关联着,之前相关功能都没出过问题,这次突然卡在这里实在摸不着头脑。

备注:内容来源于stack exchange,提问作者TheGreatCornholio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 10:58:14