My ads shows correctly on emulator, but when i test it on real devices, it doesnt show ads. here is my code below:
=>lib/main.dart;
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_admob/firebase_admob.dart';
const String testDevice = 'ca-app-pub-366*******150~415*****06';
const String DWWCBannerAdUnit = "ca-app-pub-3666******50/910*****770";
const String DWWCAppId = "ca-app-pub-366*******150~415*****06";
Future<void> main() async{
WidgetsFlutterBinding.ensureInitialized();
BannerAd createBannerAd() {
return BannerAd(
adUnitId: DWWCBannerAdUnit,
size: AdSize.banner,
listener: (MobileAdEvent event) {
print("BannerAd event $event");
},
);
}
await Firebase.initializeApp();
FirebaseAdMob.instance.initialize(appId: DWWCAppId,);
createBannerAd()
..load()
..show();
runApp(dwwc());
}
question from:
https://stackoverflow.com/questions/65643087/firebase-admob-not-displaying-ads-on-real-device-in-flutter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…