- I got verifyed Admob ac.
- I created key with keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key
- I create firebase ac and connect the app, firebase approved the communication but still it gives ad error
In AdvertClass
import 'dart:io';
class AdvertService {
static final AdvertService _instance = AdvertService._internal();
factory AdvertService() => _instance;
MobileAdTargetingInfo _targetingInfo;
final String _bannerAd = Platform.isAndroid
? 'ca-app-pub-6xxxxxxxxx01/xxxxxx5'
: 'ca-app-pub-67xxxxxxxx01/2xxxxxx';
AdvertService._internal() {
//USB cabled android, got that id with adb devices
_targetingInfo = MobileAdTargetingInfo( testDevices: <String>["54a0a4f2"]);
}
showBanner() {
print(_bannerAd);
BannerAd banner = BannerAd(
adUnitId: _bannerAd,
size: AdSize.smartBanner,
targetingInfo: _targetingInfo);
banner
..load()
..show();
banner.dispose();
}
}