Как правильно добавить Admob в проект Flutter? - PullRequest
0 голосов
/ 21 декабря 2018

У меня есть проект Flutter, который использует пакет Firebase_Admob.Для iOS все работает, как и ожидалось, но мой экземпляр Android получает следующую ошибку ...


* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
* App ID inside the AndroidManifest. Google Ad Manager publishers should     *
******************************************************************************

Так выглядит мой AndroidManifest ...

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="myfavkpopapp_example"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- This keeps the window background of the activity showing
                 until Flutter renders its first frame. It can be removed if
                 there is no splash screen (such as the default splash screen
                 defined in @style/LaunchTheme). -->
            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
            <meta-data
                    android:name="com.google.android.gms.ads.APPLICATION_ID"
                    android:value="ca-app-pub-[ADMOB ID]"/>
            <meta-data
                    android:name="com.google.android.gms.version"
                    android:value="@integer/google_play_services_version" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

1 Ответ

0 голосов
/ 28 декабря 2018

Вы должны добавить свой реальный идентификатор AdMob здесь:

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-[ADMOB ID]"/>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...