Orientação gerada a partir de informações públicas. Apenas para referência.
admob_flutter é um plugin Flutter que permite a integração de anúncios banner do Google AdMob em aplicativos móveis usando visualizações nativas da plataforma. Ele oferece uma maneira simples de exibir anúncios banner monetizáveis em plataformas Android e iOS. O plugin utiliza os SDKs nativos do AdMob para desempenho e compatibilidade ideais, garantindo a exibição suave de anúncios dentro dos aplicativos Flutter. É projetado para desenvolvedores que buscam gerar receita por meio de publicidade no aplicativo com configuração mínima. O pacote oferece carregamento dinâmico de anúncios e dimensionamento responsivo de banners, melhorando a experiência do usuário em diferentes dispositivos.
Casos de uso
Monetizando aplicativos móveis com anúncios em banner
Integrando o Google AdMob em projetos Flutter
Exibindo anúncios de banner responsivos no Android e no iOS
Adicionando publicidade no aplicativo sem código nativo
Habilitar atualizações e refresh em tempo real de anúncios
Principais recursos
Integração de visualização de plataforma nativa
Suporte para Android e iOS
Dimensionamento de banner responsivo
Integração fácil com o Firebase
Carregamento e atualização em tempo real de anúncios
Código mínimo de boilerplate
Indicado para
Desenvolvedores Flutter procurando monetização por anúncios
Aplicativos direcionados para usuários do Android e iOS
Projetos usando o Firebase para análise
Desenvolvedores que desejam integração simples do AdMob
Aplicativos móveis com o objetivo de gerar receita por meio de banners
Considerações
Requer configuração da conta do Google AdMob
Depende de SDKs nativos para funcionalidade completa
Conteúdo de anúncio sujeito às políticas do Google
Pode afetar o desempenho do aplicativo se usado em excesso
A experiência do usuário pode ser afetada por exibições frequentes de anúncios
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
Looking for Maintainers.
Unfortunately I haven't been able to keep up with demand for features and improvments. If you are interested in helping maintain this repo please create an issue requesting maintainer status. Or consider using the new google_mobile_ads by Google.
admob_flutter
A Flutter plugin that uses native platform views to show Admob banner ads!
This plugin also has support for Interstitial and Reward ads.
Installation
Add this to your package's pubspec.yaml file:
dependencies:admob_flutter:"<LATEST_VERSION>"
Install it - You can install packages from the command line:
flutter pub get
Android Specific Setup
Update your AndroidManifest.xml
Add your AdMob App ID to your app's AndroidManifest.xml file by adding the <meta-data> tag shown below. You can find your App ID in the AdMob UI. For android:value insert your own AdMob App ID in quotes, as shown below.
You can use these test App ID's from Admob for development:
Starting from Beta 6, you also need to display the App Tracking Transparency authorization request for accessing the IDFA,
so you have to update your Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing your usage.
Below is an example description text:
<key>NSUserTrackingUsageDescription</key><string>This identifier will be used to deliver personalized ads to you.</string>
See Prepare for iOS 14+ for more information.
You also need to update your ios/Podfile by adding platform :ios, '9.0' at the very top of your file.
Initialize the plugin
First thing to do before attempting to show any ads is to initialize the plugin. You can do this in the earliest starting point of your app, your main function:
import'package:admob_flutter/admob_flutter.dart';
voidmain() {
WidgetsFlutterBinding.ensureInitialized();
// Initialize without device test ids.Admob.initialize();
// Or add a list of test ids.// Admob.initialize(testDeviceIds: ['YOUR DEVICE ID']);
}
If you're using iOS, you may also need to request the tracking authorization in order to display personalized ads:
// Run this before displaying any ad.awaitAdmob.requestTrackingAuthorization();
TL;DR - Make sure you have the correct combination of id's per platform. See:161
Objective-C based project cannot build
TL;DR - You have to enable swift support for your flutter project. See: stackoverflow and 123
How do I manage consentement for users in the European Economic Area?
Pass nonPersonalizedAds: true to the classes constructor (AdmobBanner, AdmobInterstitial and AdmobReward) in order to not display personalized ads for users who don't give their consent. A way to ask users for their consent is to use the plugin admob_consent. Please note that the new recommended is to use the brand new UMP SDK (Android, iOS).