Adrop Ads - Flutter

Adrop ads plugin for Flutter

pub package pub points Platform License

Language: English | 한국어

Getting Started

Examples

Adrop Ads

Ad Format Example
Banner banner_example.dart
Interstitial interstitial_example.dart
Rewarded rewarded_example.dart
Popup popup_example.dart
Native native_example.dart

Targeting

Example
Property & Event property_example.dart

Note: Consent features require AdropAdsBackfill module.

Example
Consent (GDPR/CCPA) consent_example.dart

How to Run Examples

1. Clone the repository

git clone https://github.com/OpenRhapsody/adrop_ads_flutter.git

2. Navigate to the example directory

cd adrop_ads_flutter/example

3. Install dependencies

flutter pub get

4. Add configuration file

Download adrop_service.json from Adrop Console and place it in:

Android

android/app/src/main/assets/adrop_service.json

iOS

Important: For iOS, you must add adrop_service.json through Xcode.

  1. Open ios/Runner.xcworkspace in Xcode
  2. Right-click on the Runner folder and select "Add Files to Runner..."
  3. Select adrop_service.json and ensure "Copy items if needed" is checked
  4. Make sure the file is added to the Runner target

5. Install iOS dependencies

cd ios && pod install && cd ..

6. Build and run

flutter run

Batch loads() — feed/list ads

Load up to 5 banners or native ads with a single network request:

// Banners: returned widgets are pre-loaded and re-attachable.
final banners = await AdropBannerView.loads(
  unitId: 'YOUR_UNIT_ID',
  listener: AdropBannerListener(
    // One listener for the batch; metadata['requestId'] identifies the slot.
    onAdClicked: (unitId, metadata) => print('clicked ${metadata?['requestId']}'),
  ),
);
// Mount banners[i] anywhere (ListView cells are fine — scroll-back re-attaches).
// You own cleanup: call dispose() on every returned widget when done.

// Native ads: instances arrive already loaded — do NOT call load() on them.
final ads = await AdropNativeAd.loads(unitId: 'YOUR_UNIT_ID');
// Bind each to AdropNativeAdView as usual; dispose() each when done.
// In a list, key the view by the ad: AdropNativeAdView(key: ValueKey(ad.requestId), ...)
// — platform views freeze their params at creation, so an unkeyed widget reused
// at the same position after a new loads() would keep showing the old ad.

Failures throw a PlatformException whose code is an AdropErrorCode name (e.g. ERROR_CODE_AD_NO_FILL). Batch ads are always direct ads (no backfill).

Libraries

adrop_ads_flutter