pubspec.yaml
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_admob: ^0.9.0+9
AndroidManifest.xml
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[ADMOB_APP_ID]"/>
Main
import 'package:firebase_admob/firebase_admob.dart';
@override
Widget (BuildContext context) {
FirebaseAdMob.instance.initialize(appId: "[ADMOB_APP_ID]");
myBanner
..load()
..show(
anchorOffset: 60.0,
horizontalCenterOffset: 10.0,
anchorType: AnchorType.bottom,
);
myInterstitial
..load()
..show(
anchorType: AnchorType.bottom,
anchorOffset: 0.0,
horizontalCenterOffset: 0.0,
);
return Scaffold(
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
keywords: <String>['games', 'game','Kids'],
contentUrl: 'https://flutter.io',
childDirected: false,
testDevices: <String>[], // Android emulators are considered test devices
);
BannerAd myBanner = BannerAd(
adUnitId: [Your Banner.Ad.Id],
size: AdSize.smartBanner,
targetingInfo: targetingInfo,
listener: (MobileAdEvent event) {
print("BannerAd event is $event");
},
);
InterstitialAd myInterstitial = InterstitialAd(
adUnitId: [Your Interstitial.Ad_Id],
targetingInfo: targetingInfo,
listener: (MobileAdEvent event) {
print("InterstitialAd event is $event");
},
);
Boa tarde,
Primeiramente Muito bom seu vídeo, parabéns,
Eu tentei reproduzir ele mas estou obtendo E/flutter (24914): PlatformException(load_failed_ad, cannot reload a failed ad, id=XXXXX, null)
Saberia como resolver?
Olá Rafael.
Esse erro costuma acontecer logo no início após a configuração.
Passado algumas horas, já começa a encontrar os anuncios.
Abraço, boa programação
Hello, yup this article is in fact fastidious and I have learned lot of things from it on the topic of blogging. Rochell Gawain Dash
Every weekend i used to visit this website, because i want enjoyment, as this this website conations really nice funny stuff too. Aimee Jared Ingles
There’s certainly a great deal to know about this subject. I like all of the points you made. Yvette Romeo Gothard
Great post. Really looking forward to read more. Fantastic. Estrella Ellis Mohsen
Great post. I am experiencing some of these issues as well.. Bonnibelle Dennet Aubarta
This post will help the internet visitors for setting up new website or even a blog from start to end. Carlyn Corbett Oca
Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the site is extremely good. Nanci Gauthier Alyssa
I do trust all the ideas you have presented to your post. Rakel Schuyler Cyb
I think the admin of this website is really working hard in favor of his website, since here every stuff is quality based information. Ginnie Nate Alsworth
I am genuinely thankful to the owner of this site who has shared this fantastic article at at this time. Lauralee Kristofer Aeriell
Hi friends, how is all, and what you desire to say concerning this article, in my view its in fact amazing for me. Rubina Geri Clarey
Some truly nice and useful information on this website, also I believe the layout contains excellent features. Susann Bernard Kaylil
What a data of un-ambiguity and preserveness of valuable experience concerning unexpected emotions. Ainslee Alexandre Graf
You made some decent points there. I viewed on the internet for the issue and found most individuals will accompany with your website. Effie Raymund Meagher
I have recently started a blog, the info you offer on this web site has helped me tremendously. Thanks for all of your time & work. Iormina Gaspar Thury
Everything is very open with a very clear clarification of the challenges. Marie-Ann Warde Toor
Enjoyed examining this, very good stuff, regards . Nadya Tracey Scottie
I was reading some of your articles on this website and I think this website is real informative! Continue putting up. Pippa Eldin Janek
My relatives all the time say that I am killing my time here at web, but I know I am getting know-how daily by reading thes fastidious posts. Allyce Pail Leiser
I am genuinely thankful to the owner of this site who has shared this fantastic article at at this time. Cthrine Osborn Adeline
I am actually happy to glance at this web site posts which consists of tons of helpful information, thanks for providing such statistics. Retha Torrey Lawford
This is my first time pay a quick visit at here and i am actually happy to read everthing at single place. Merrily Egan Meares
I blog frequently and I truly appreciate your content. The article has truly peaked my interest. Rora Sherwin Barimah