googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
341 stars 286 forks source link

Full-screen native ad (platform view) not covering full screen #1188

Closed hina06botify closed 2 days ago

hina06botify commented 2 weeks ago

I'm trying the following code to load a native full-screen ad: _adsController.nativeFullScreen = NativeAd( adUnitId: "ca-app-pub-3940256099942544/2247696110", factoryId: 'GoogleFullScreenAds', nativeAdOptions: NativeAdOptions(mediaAspectRatio: MediaAspectRatio.portrait), listener: NativeAdListener( onAdLoaded: (ad) { log('$NativeAd native full screen loaded successfully'); _adsController.fullScreenNativeIsLoaded.value = true; }, onAdFailedToLoad: (ad, error) { log('$NativeAd native full screen failed to load: $error'); ad.dispose(); if (_adsController.adType.value == 3) { _adsController.showNativeFullScreen1 = NativeAdShowType.Facebook; preloadFullFbNativeAd(); } _adsController.fullScreenNativeAdIsError.value = true; }, ), request: const AdRequest(), )..load();

However, the ad does not cover the full screen. In my native ad template, the MediaView is defined as follows:

xml: <com.google.android.gms.ads.nativead.MediaView android:id="@+id/ad_media" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/linTopView" /> I want the native template to display a full-screen image, but it's not displaying correctly. How can I fix this issue to ensure that the image appears in full screen?

malandr2 commented 2 weeks ago

Hi @hina06botify, can you send over a minimal, reproducible, example and I can take a look?

aykutuludag commented 4 days ago

Probably similar issue: https://github.com/googleads/googleads-mobile-flutter/issues/1196

malandr2 commented 3 days ago

@aykutuludag unrelated as this isn't directly related to foreground/background