패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.1

admob_easy

Google AdMob과의 Flutter 앱 통합을 단순화하여 수익 창출을 쉽게 만듭니다.

AndroidiOS
30일 다운로드
159
좋아요
26
Pub 점수
130

패키지 설치

flutter pub add admob_easy

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

admob_easy는 Google AdMob과의 통합을 간소화하는 Flutter 패키지로, 개발자가 안드로이드 및 iOS 앱에 광고를 빠르게 추가할 수 있도록 도와줍니다. 바너, 인터스티셜, 리워드 광고를 표시하기 위한 사용하기 쉬운 API를 제공하며, 네이티브 광고 구현에 대한 깊은 지식이 필요하지 않습니다. 패키지는 초기화 및 광고 로딩을 원활하게 처리하여 반복 코드를 줄이고 수익화 프로세스를 간소화합니다. 앱에서 수익을 창출하고자 하는 개발자에게 이상적입니다.

사용 사례

  • 배너 광고를 통한 모바일 앱 수익화
  • 앱 화면 사이에 인터스티셜 광고 표시
  • 사용자 인센티브를 위한 보상형 비디오 광고 구현
  • 네이티브 코드 없이 빠른 광고 통합 추가
  • 소규모에서 중규모 프로젝트용 앱 내 광고 활성화

주요 기능

  • 광고 배치를 위한 간단한 API
  • 배너, 인터스티셜 및 보상 광고 지원
  • 자동 광고 초기화
  • 크로스 플랫폼 호환성 (Android 및 iOS)
  • 최소한의 설정 필요

적합한 대상

  • 초보자 플러터 개발자
  • 빠른 광고 통합이 필요한 앱
  • 개발 시간이 제한된 프로젝트
  • 독립 개발자들이 수익화에 집중
  • 작은부터 중간 규모의 앱에서 간편한 광고 지원을 찾고 있습니다

고려 사항

  • Google AdMob 계정 설정이 필요합니다
  • 광고 성능은 네트워크 가용성에 따라 달라집니다
  • AdMob 정책 준수를 요구할 수 있습니다
  • 네이티브 SDK에 비해 사용자 맞춤 설정이 제한적
  • 복잡한 광고 로직이나 고급 타겟팅에 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Admob Easy

This documentation guides integrating ads into a Flutter application using the provided helper classes.
AdMob Easy automatically handles the User Messaging Platform (UMP) for you, ensuring compliance with privacy regulations.


Android Manifest File (Android)

<manifest>
    ...
    <application>
       ...
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3940256099942544~3347511713"/>
    </application>
</manifest>

iOS Info.plist File (iOS)

...
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
...

Initialize MobileAds

To enable ad support, initialize AdmobEasy in the Splash Screen by providing the necessary ad unit IDs and test devices:

AdmobEasy.instance.initialize(
  androidRewardedAdID: 'ca-app-pub-3940256099942544/5224354917',
  androidInitAdID: 'ca-app-pub-3940256099942544/1033173712',
  androidBannerAdID: 'ca-app-pub-3940256099942544/6300978111',
  androidAppOpenAdID: 'ca-app-pub-3940256099942544/9257395921',
  testDevices: ['543E082C0B43E6BF17AF6D4F72541F51'],
);

Load Ads

Use the provided methods to load ads:

AdmobEasy.instance.createRewardedAd(context);    // Load rewarded ad
AdmobEasy.instance.createInterstitialAd(context); // Load Interstitial ad
AdmobEasy.instance.loadAppOpenAd();              // Load App Open Ad (shows automatically after load)

Show Ads

Once ads are loaded, show them using:

AdmobEasy.instance.showRewardedAd(context);
AdmobEasy.instance.showInterstitialAd(context);

Native Ads (New API)

Native ads are now handled via methods mixed directly into AdmobEasy.
You can preload, show, and dispose native ads with full control.


Load a Native Ad

AdmobEasy.instance.loadNativeAd(
  templateType: TemplateType.medium,
  minWidth: 320,
  minHeight: 90,
  maxWidth: 400,
  maxHeight: 200,
  adID: "ca-app-pub-3940256099942544/2247696110", // optional custom ID
  onAdClicked: (ad) => print("Ad Clicked"),
  onAdImpression: (ad) => print("Ad Impression Logged"),
  onAdClosed: (ad) => print("Ad Closed"),
  onAdOpened: (ad) => print("Ad Opened"),
  onAdWillDismissScreen: (ad) => print("Ad will dismiss screen"),
  onPaidEvent: (ad, value, precision, currencyCode) {
    print("Paid event: $value $currencyCode (precision: $precision)");
  },
);

Show a Native Ad

Once preloaded, show it anywhere in the widget tree:

class NativeAdScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Native Ad Example')),
      body: Center(
        child: AdmobEasy.instance.showNativeAd(
          minWidth: 320,
          minHeight: 90,
          maxWidth: 400,
          maxHeight: 200,
        ),
      ),
    );
  }
}

Dispose a Native Ad

When you no longer need the preloaded ad:

@override
void dispose() {
  AdmobEasy.instance.disposeNative();
  super.dispose();
}

Parameters

  • adID → Custom AdMob Unit ID (if null, defaults to AdmobEasy.instance.nativeAdID).
  • templateType → Choose between TemplateType.small or TemplateType.medium.
  • minWidth, minHeight, maxWidth, maxHeight → Controls the size of the ad container.
  • onAdClicked → Callback when the ad is clicked.
  • onAdImpression → Callback when an ad impression is logged.
  • onAdClosed → Callback when the ad is closed.
  • onAdOpened → Callback when the ad is opened.
  • onAdWillDismissScreen → Callback when the ad is about to dismiss the screen.
  • onPaidEvent → Callback for handling paid events from the ad.

Best Practices for Native Ads

✅ Preload early – Call loadNativeAd() on your splash screen or just before the screen where the ad will be shown.
✅ Dispose when unused – Always call disposeNative() when leaving the screen to free memory.
✅ Avoid multiple preload calls – The mixin ensures only one native ad is preloaded at a time.
✅ Handle callbacks – Use onAdClicked, onAdImpression, and onPaidEvent to track engagement and revenue.
✅ Fallback UI – If no ad is preloaded, showNativeAd() automatically shows a loading placeholder.


Internet Connectivity

Admob Easy automatically checks if the device is online before loading ads.

You can check connectivity manually:

AdmobEasy.instance.isConnected.value; // true if connected

Or use a listener:

ValueListenableBuilder(
  valueListenable: ConnectivityController.instance.isConnected,
  builder: (_, value, child) {
    return Text(value ? "Connected" : "No Internet");
  },
);

You can also initialize connectivity monitoring:

AdmobEasy.instance.initConnectivity(
  onOnline: () => print("Online"),
  onOffline: () => print("Offline"),
);

Support

If you find this package useful and want to support its development, you can buy me a coffee:

Buy Me a Coffee

Thank you for your support!


Contributions are welcome!

Feel free to submit bug reports, feature requests, or pull requests on GitHub.

카테고리

의존성

의존성 목록 4 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.