Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
377 views
in Technique[技术] by (71.8m points)

Firebase Admob not displaying ads on Real Device in Flutter

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...