【问题标题】:Where did the Google Admob Ads App Id go?Google Admob 广告应用 ID 去哪儿了?
【发布时间】:2020-07-27 17:00:01
【问题描述】:

我正在按照官方 documentation 将我的应用程序更新为新的 Google Ads Play Services API (19.3.0),但我在任何地方都找不到有关将 Admob 应用程序 ID 放置在何处的信息(带有 @ 的那个) 987654322@).

应用 ID 是否已弃用?现在广告单元 ID 是否足够(带有/ 的那个)?我错过了什么?

MobileAds.initialize(context) 的调用也变得不必要了吗?

【问题讨论】:

    标签: android admob google-play-services ads


    【解决方案1】:

    在清单中。

    需要调用 MobileAds.initialize(context)。

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="com.example.smh">
    
        <application
            android:allowBackup="false"
            android:icon="@drawable/ic_icon_app_square"
            android:label="@string/app_name"
            android:roundIcon="@drawable/ic_icon_app_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"">
            <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value=" **app id goes here** " />
    
            <activity
                android:name=".MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
    
            </activity>
        </application>
    
    </manifest>
    

    【讨论】:

    • 对我来说这似乎是个老新闻了。您能否通过 Google 官方文档的链接来支持您的回答?
    • 你为什么不试试看?
    • 我毫不怀疑“它有效”。但这不是我的问题。来自 Google 的文档用于准确显示您的建议。这已经改变了。我的问题是:来自 Google 的新文档是否意味着不再需要 App Id?
    猜你喜欢
    • 1970-01-01
    • 2011-03-03
    • 2014-03-15
    • 2015-07-17
    • 2012-10-30
    • 2013-05-23
    • 1970-01-01
    • 2012-03-13
    • 1970-01-01
    相关资源
    最近更新 更多