Buy Me A Coffee

Full screen/Inline native ads

This package supports fullscreen and inline native ads on android. (No access to xcode as of now). Please visit example for how to use.

Liked my work ? support me


While setting up google mobile ads just change the adfactory implementation defined in this package. your should look like the following.

package com.example.google_native_mobile_ads_example;
import com.example.google_native_mobile_ads.NativeAdFactoryImplementation;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.googlemobileads.GoogleMobileAdsPlugin;

public class MainActivity extends FlutterActivity {
    public void configureFlutterEngine(FlutterEngine flutterEngine) {
        final GoogleMobileAdsPlugin.NativeAdFactory factory = new NativeAdFactoryImplementation(getLayoutInflater()); // reference to this package created factory
        GoogleMobileAdsPlugin.registerNativeAdFactory(flutterEngine, "google_native_mobile_ads_AdFactory", factory);

    public void cleanUpFlutterEngine(FlutterEngine flutterEngine) {
        GoogleMobileAdsPlugin.unregisterNativeAdFactory(flutterEngine, "google_native_mobile_ads_AdFactory");

Add application id in AndroidManifest.xml


How to use on flutter side

for full example please view example/main.dart

    nativeAd = NativeAd(
      adUnitId: widget.adUnitId,

      /// This does the job to show fullscreen ads
      customOptions: NativeAdCustomOptions.defaultConfig().toMap, // This does the job to show full screen ad
      nativeAdOptions: NativeAdOptions(
        adChoicesPlacement: AdChoicesPlacement.topLeftCorner,
        mediaAspectRatio: MediaAspectRatio.any,
        videoOptions: VideoOptions(
          clickToExpandRequested: true,
          customControlsRequested: true,
          startMuted: true,
        //shouldRequestMultipleImages: true,
      request: const AdRequest(),

      /// This needs not to be changed
      factoryId: NativeAdConfig.adFactoryId, // This is also required