小编Toe*_*mel的帖子

Android 用户消息传递平台 isConsentFormAvailable 返回 false

我遵循了本指南https://developers.google.com/admob/ump/android/quick-start,我的代码如下所示:

    private fun checkForConsent() {
/*
        val debugSettings = ConsentDebugSettings.Builder(this)
            .setDebugGeography(ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_EEA)
            .addTestDeviceHashedId("69887E2CBBE5346EC3B54A3FD207AB41")
            .build()
        val params = ConsentRequestParameters.Builder()
            .setConsentDebugSettings(debugSettings)
            .build()
        */


        Log.d("adstuff", "check Consent")
        val params = ConsentRequestParameters.Builder().build()
        // Set tag for under age of consent. Here false means users are not under age
        //Log.d("adstuff", params.isTagForUnderAgeOfConsent.toString())

        consentInformation = UserMessagingPlatform.getConsentInformation(this)

        //consentInformation.reset();
        consentInformation.requestConsentInfoUpdate(
            this,
            params,
            object : ConsentInformation.OnConsentInfoUpdateSuccessListener {
                override fun onConsentInfoUpdateSuccess() {
                    // The consent information state was updated.
                    // You are now ready to check if a form is …
Run Code Online (Sandbox Code Playgroud)

forms android admob android-studio ump

6
推荐指数
1
解决办法
1615
查看次数

标签 统计

admob ×1

android ×1

android-studio ×1

forms ×1

ump ×1