Я не могу отобразить свой рекламный блок на своем устройстве в тестовом приложении.
Я использую плагин firebase_admob 0.9.1 + 1
Это код, который я использую:
import 'package:firebase_admob/firebase_admob.dart';
Future initAppAds() async {
//Récupère du coup le bon ID selon si je suis sous IOS ou Android
print(getAppId());
await FirebaseAdMob.instance.initialize(appId: 'ca-app-pub-xxxxxxxxMyAppIdxxxxxxxxxxx');
}
Future launchAds() async {
print("launchAds");
print(getInterstitialId());
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
nonPersonalizedAds: true,
);
InterstitialAd myInterstitial = InterstitialAd(
adUnitId: 'ca-app-pub-xxxxxxxxxxxxx/xxxxMyAdBloc',
targetingInfo: targetingInfo, //Info de l'utilisateur
listener: (MobileAdEvent event) {
print("InterstitialAd event is $event");
},
);
await myInterstitial.load();
await myInterstitial.show(
anchorType: AnchorType.bottom,
anchorOffset: 0.0,
horizontalCenterOffset: 0.0
);
}
Вот журнал, который я получаю:
2866-2866/com.fabien.movizz I/Ads: Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("6C11832B439BDE4C399171C8D4CC6515") to get test ads on this device.
6769-3457/? W/Ads: App does not have the required permissions to get location
6769-3539/? I/Ads: SDK version: afma-sdk-a-v20088999.15301000.1
6769-3539/? W/Ads: Received error HTTP response code: 400
2866-2866/com.fabien.movizz I/Ads: Ad failed to load : 0
Итак, я указал идентификатор моего устройства следующим образом:
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
nonPersonalizedAds: true,
testDevices: <String>["6C11832B439BDE4C399171C8D4CC6515"],
);
Но реклама все равно не появляется , Вот журнал, который я получаю:
2866-2866/com.fabien.movizz I/Ads: This request is sent from a test device.
6769-3380/? W/Ads: App does not have the required permissions to get location
6769-3457/? I/Ads: SDK version: afma-sdk-a-v20088999.15301000.1
6769-3457/? W/Ads: Received error HTTP response code: 400
2866-2866/com.fabien.movizz I/Ads: Ad failed to load : 0
Если я использую тестовое объявление , предоставленное Google , объявление работает хорошо, и вот журнал, который я получаю:
2866-2866/com.fabien.movizz I/Ads: This request is sent from a test device.
6769-3539/? W/Ads: App does not have the required permissions to get location
6769-5440/? I/Ads: SDK version: afma-sdk-a-v20088999.15301000.1
Что не так с моим рекламным блоком? Я создал его 2 дня go, я ждал достаточно долго, чтобы он появился?
Спасибо за вашу помощь;)
Вот мой флаттер-доктор: