Monetization Kit

A powerful Flutter monetization toolkit that combines AdMob ads, Firebase services, force updates, feedback reporting, analytics, remote config, and reusable monetization utilities into a single package.

Development Status

monetization_kit is currently under active development. While the core features are stable, some APIs, implementations, and integrations may evolve in future releases.

Please thoroughly test ad flows, Firebase setup, native ad factories, force update behavior, and feedback systems before using this package in production environments.


Features

Ads

  • Banner Ads

  • Collapsible Banner Ads

  • Native Ads

    • Small
    • Medium
    • Fullscreen
    • Custom Factory Support
  • Native Popup Ads

  • Fullscreen Native Timer Ads

  • Interstitial Ads

  • Rewarded Ads

  • App Open Ads

  • App Resume Ads


Smart Ad Systems

  • Global Ad Controller
  • Premium User Ad Disable
  • Remote Ad Enable / Disable
  • Ad Frequency Manager
  • Placement Based Ad Logic
  • Cooldown Management
  • Retry System
  • Auto Reload After Dismiss
  • Ad Preload Manager
  • Native Ad Cache System
  • Default Shimmer Loading UI
  • Smart Ad Fallback Logic

Firebase

  • Firebase Core
  • Firebase Analytics
  • Firebase Crashlytics
  • Firebase Remote Config

Updates

  • Android In-App Update
  • iOS App Store Update
  • Force Update System
  • Dynamic Update Dialog

Feedback System

  • Discord Webhook Integration
  • Modern Feedback Screen
  • Screenshot Attachment Support
  • Automatic Device Information Collection
  • Automatic App Information Collection
  • Custom Metadata Support

Collected automatically:

  • App Name
  • App Version
  • Build Number
  • Platform
  • Device Model
  • Device ID
  • User Agent
  • Timestamp

Users only need to provide:

  • Feedback Description
  • Optional Screenshot

Installation

dependencies:
  monetization_kit: ^0.0.3

Initialize

await MonetizationKit.initialize(
  config: MonetizationConfig(
    iosStoreId: 'YOUR_IOS_APP_STORE_ID',

    adUnitIds: AdUnitIds(
      androidBanner: 'ANDROID_BANNER_ID',
      iosBanner: 'IOS_BANNER_ID',

      androidInterstitial: 'ANDROID_INTERSTITIAL_ID',
      iosInterstitial: 'IOS_INTERSTITIAL_ID',

      androidRewarded: 'ANDROID_REWARDED_ID',
      iosRewarded: 'IOS_REWARDED_ID',

      androidAppOpen: 'ANDROID_APP_OPEN_ID',
      iosAppOpen: 'IOS_APP_OPEN_ID',

      androidNativeSmall: 'ANDROID_NATIVE_ID',
      iosNativeSmall: 'IOS_NATIVE_ID',

      androidNativeMedium: 'ANDROID_NATIVE_ID',
      iosNativeMedium: 'IOS_NATIVE_ID',

      androidNativeFull: 'ANDROID_NATIVE_ID',
      iosNativeFull: 'IOS_NATIVE_ID',
    ),
  ),
);

Banner Ads

const BannerAdWidget()

Native Ads

Small Native

const NativeAdWidget(
  type: NativeAdType.small,
)

Medium Native

const NativeAdWidget(
  type: NativeAdType.medium,
)

Full Native

const NativeAdWidget(
  type: NativeAdType.full,
)

Fullscreen Native Timer Ad

await FullscreenNativeTimerAd.show(
  context,
  duration: const Duration(
    seconds: 10,
  ),
);

Native Popup Ad

await NativePopupAd.show(
  context,
  type: NativeAdType.full,
);

Interstitial Ad

await InterstitialAdService.show(
  context: context,
);

Rewarded Ad

await RewardedAdService.show(
  onRewardEarned: (reward) {
    print(reward.amount);
  },
);

Premium User

Disable ads for premium users:

AdController.setPremiumUser(true);

Disable Ads

AdController.disableAds();

Enable again:

AdController.enableAds();

Force Update

await ForceUpdateService.checkForUpdate(
  context: context,
);

Analytics

Screen Tracking

await AnalyticsService.logScreenView(
  screenName: 'HomeScreen',
);

Custom Event

await AnalyticsService.logEvent(
  name: 'generate_image_clicked',
);

Ad Impression

await AnalyticsService.logAdImpression(
  adType: 'interstitial',
);

Feedback Screen

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (_) => const FeedbackScreen(
      webhookUrl:
          'YOUR_DISCORD_WEBHOOK_URL',
    ),
  ),
);

Discord Feedback Service

final feedback =
    DiscordFeedbackService(
  webhookUrl:
      'YOUR_DISCORD_WEBHOOK_URL',
);

await feedback.sendFeedback(
  description:
      'App crashes on scanner screen',
);

Remote Config Keys

Key Type
ads_enabled bool
banner_enabled bool
interstitial_enabled bool
rewarded_enabled bool
native_enabled bool
app_open_enabled bool
interstitial_click_count int
force_update bool
force_update_android_version int
force_update_ios_version int
maintenance_mode bool

Native Ad Factory IDs

Default factory IDs:

customNativeAd
customNativeAdSmall
fullscreenNativeAd

Android Native Setup

Add native factories inside:

android/app/src/main/kotlin/

Add layouts inside:

android/app/src/main/res/layout/

Reference implementation:

example/native_reference/android/

iOS Native Setup

Add native factories inside:

ios/Runner/

Reference implementation:

example/native_reference/ios/

Included Systems

  • Retry Config
  • Auto Preload
  • Auto Reload
  • App Resume Ads
  • Native Cache
  • Frequency Logic
  • Cooldown Logic
  • Dynamic Update Dialog
  • Smart Ad Fallbacks
  • Feedback Reporting

Example

A complete example application is included inside:

example/

License

MIT License

Libraries

monetization_kit