admob_flutter는 네이티브 플랫폼 뷰를 사용하여 모바일 애플리케이션에 Google AdMob 배너 광고를 통합할 수 있도록 해주는 Flutter 플러그인입니다. Android 및 iOS 플랫폼에서 수익 창출 가능한 배너 광고를 표시하는 간단한 방법을 제공합니다. 최적의 성능과 호환성을 위해 네이티브 AdMob SDK를 활용하여 Flutter 앱 내에서 광고가 원활하게 렌더링되도록 보장합니다. 최소한의 설정으로 앱 내 광고를 통해 수익을 얻고자 하는 개발자를 위한 것입니다. 이 패키지는 동적 광고 로딩과 반응형 배너 크기 조정을 지원하여 다양한 기기에서 사용자 경험을 향상시킵니다.
사용 사례
배너 광고를 통한 모바일 앱 수익화
Flutter 프로젝트에 Google AdMob 통합하기
Android 및 iOS에서 반응형 배너 광고 표시
네이티브 코드 없이 앱 내 광고 추가
실시간 광고 업데이트 및 새로 고침 활성화
주요 기능
네이티브 플랫폼 뷰 통합
Android 및 iOS 지원
반응형 배너 크기
Firebase와의 간편한 통합
실시간 광고 로딩 및 새로 고침
최소한의 보일러플레이트 코드
적합한 대상
광고 수익화를 찾는 플러터 개발자
안드로이드 및 iOS 사용자를 대상으로 하는 앱
분석에 Firebase를 사용하는 프로젝트
간단한 AdMob 통합을 원하는 개발자
배너를 통해 수익을 창출하려는 모바일 앱
고려 사항
Google AdMob 계정 설정이 필요합니다
완전한 기능을 위해 네이티브 SDK에 의존합니다
광고 콘텐츠는 Google 정책의 대상입니다
과도하게 사용할 경우 앱 성능에 영향을 줄 수 있습니다
자주 광고가 표시되면 사용자 경험에 영향을 줄 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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).