Flutter: Google native ads integrated into a Flutter widget tree

Created on 15 Sep 2017  ·  133Comments  ·  Source: flutter/flutter

This comment discusses the different ways we are considering addressing this issue, and provides links to more specific issues that cover specific steps towards this issue: https://github.com/flutter/flutter/issues/12114#issuecomment-505633342
We are working on some of these today. Please see the individual bugs for details.


Both Firebase (AdMob) and Facebook support a "Native Ads" format:

Native ads are rendered inline with the app's content, with rendering and formatting (colors, fonts) controlled by the app itself.

P3 crowd firebase firebase_admob passed first triage plugin new feature transferred

Most helpful comment

Re-activating again. #8098 was restricted to track just banner & interstitial support.

If support for Admob Native ads is important to you, please consider "casting a vote" on this by clicking 'thumbs up' on the top-most comment of this bug.

All 133 comments

Would it not be better to have DFP support? Would allow us to integrate a wider range of products, including in house banners, Ad Exchange/AdSense along with native / fluid ads?

Thanks for your feedback! Can you link us to DFP?

I think @gcshri means DoubleClick for Publishers, which funnily enough was formerly called DART 😄

Full circle!

On Thu, Oct 12, 2017, 11:34 Eugenio Marletti notifications@github.com
wrote:

I think @gcshri https://github.com/gcshri means DoubleClick for
Publishers https://en.wikipedia.org/wiki/DoubleClick_for_Publishers,
which funnily enough was formerly called DART 😄


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/12114#issuecomment-336227022,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAVZzZFhnb80PxDhsBj6k_30sbrs7qXks5srlu6gaJpZM4PZQgi
.

Yep. Avoided Dart as I kept thinking it was some scripting language that came out of the doubleclick shop. But seriously, integration with DFP would open up Flutter to some of us who rely on ad revenue from Google and other sources.

Thanks. If you can add some links for APIs relevant to DFP, we (and the community) can take a look at what the requirements are.

This would probably be the relevant link.

https://developers.google.com/doubleclick-publishers/docs/clients

Most of the publishers will use the javascript implementation on the web or
on HTML5 / hybrid apps.

Git Repos:

https://github.com/googleads

Re-activating again. #8098 was restricted to track just banner & interstitial support.

If support for Admob Native ads is important to you, please consider "casting a vote" on this by clicking 'thumbs up' on the top-most comment of this bug.

Is this even possible without some work on the Admob side? I mean Flutter uses custom drawn controls and native ads use native controls.

Generally this issue is the main stopper to use Flutter in my current project as I don't know when it will be possible to use the native ads and whether it will be possible at all.

This would be a great addition where Native Ads can be displayed inline with the content of the app.

any progress on this?

We (community) really need this. Any progress on this?

Even Unity games (and apps) can show native ads: https://developers.google.com/admob/unity/custom-native

Agreed, this feature is really needed. Bit ambitious, but could we get this into the 1.0 milestone or earlier? cc @mit-mit

Sorry, we don't have a timeline we can offer for this feature.

If it cannot be done as a flutter widget, is it possible that we (i.e. me) can look at editing the kotlin / swift versions of the code and using the mobile ads sdk with them? Not too sure about how Flutter works, but I assume that since it allows hooking into native APIs, this should be possible?

If devs will be able to use the AdMob package and position it using guidelines and approval of some sort it would be amazing - both from user and dev in my opinion.

any progress?

Any progress on this. This thing is needed quite badly.

Does this feature require core changes to the flutter engine?

Any planned release on this one?

I'm also wondering if there is a planned release or any news at all. I would love to use flutter for my upcoming project, but native ads are critical. I don't want an ugly banner at the bottom of my app...

Same thing. Native ads are necessary for a good looking application..

Waiting for this thing for so long :'(

Any love for this most requested feature? Other related 3rd party packages are not maintaned. So this is the only hope.

I'm a student and want to earn some money on the side with my application, but the default ad types are just too obtrusive. I really hope something can be done about this soon.

I use rxDart package in my project, and get the data from the server as streams, added firebase_admob and show ads in app, but when the advertisement on the banner changes, then my streams start automatically. Why so?

Looks promising .. https://github.com/YoussefKababe/admob_flutter

@Purus - any other reason preventing you from using the above mentioned plugin aside from lack of iOS and AndroidX support? I believe the latter should be resolved soon, considering the recent developments there...

@theneshofficial - does https://pub.dartlang.org/packages/flutter_google_ad_manager support native ads?

We have a plugin for our app that successfully implements native ads (AdMob). We have it implemented via AndroidViews and UIKitViews. Sadly the AdMob SDK forces you to embed the ad inside a UnifiedNativeAd, so you can't send the ad data to Flutter. That's also why writing a Flutter plugin for this is not at all easy. Instead, we essentially produce most of the UI in Dart, and then create all the text, images, etc in Android/iOS themselves, which is then overlaid onto the flutter UI. This works, although of course not preferable due to having to build layouts for both platforms. Nonetheless, the ads display fine, they can be clicked on, etc.

However, there are two big blockers for us, the state of UIKitViews and performance in general. For the former, as can be seen in #25965, UIKitViews can currently not be clipped. This means they glitch through certain UI elements, such as the TabBar. For the latter, the problem is that embedding the platform views hits our UI performance. We've gone to great lengths to minimize the performance hit, to the point where we no longer have any method channels for this plugin (we used to be able to track when the ad had loaded, but that call was directly related to a hitch in UI performance). Nonetheless, particularly upon startup, there is a significant amount of jank related to the creation of just one of these platform views. Loading indicators and animations in general halt for around a second. This performance hit becomes less after that, but since we would ideally like to embed the ad inside a list, we are unable to maintain 60 FPS while scrolling (performance profiler shows a max of about 100 ms per frame).

Here's a small sample for the Java code. The iOS side is the same thing really.

    private UnifiedNativeAd mAd;
    private FrameLayout mView;

    FlutterAdView(Context context, Registrar registrar, int id) {
        mView = ... // Create a placeholder view

        // request an ad
    }

    @Override
    public View getView() {
        return mView;
    }

    @Override
    public void onUnifiedNativeAdLoaded(final UnifiedNativeAd unifiedNativeAd) {
        mAd = unifiedNativeAd;

        /* Inflate your layout
        /* ...
        */

        /* Set your views
        /* ...
        */

        adView.setNativeAd(ad);

        mView.addView(adView);
    }

    // Don't forget about dispose, etc


@JaspervanRiet - man, you are basically strip out the main Flutter pros - cross platform, while implementing the native Ads. I don't think it makes sense to use Flutter in your case. Would you take a look at https://github.com/YoussefKababe/admob_flutter and see if that approach wouldn't get you back to a Flutter realm?

@angel1st Those are banner ads, implemented in almost the exact same way. We need native ads. We still make use of Flutter's power for every other part of the app, so your reply makes no sense to me. This is a restriction in the ad SDK, I can't imagine this changing anytime soon unless an official ad SDK for Flutter is released due to the restriction on using UnifiedNativeAd.

We @dreamsoftin have implemented Facebook Audience Network for Flutter (https://github.com/dreamsoftin/facebook_audience_network). Currently the plugin is Android only and it supports Banner, Interstitial, Rewarded Video, In Stream Video & Native Ads. I'm looking for some one who can help us in implementing iOS part of it.

Native Ad Demo:

Any progress? would love this to be available with flutter

Hey guys, devs are prioritizing the most liked (👍) issues by order, so keep upvoting the issue. Thanks!

I am just not able to update my flutter app because of this (native ads), if you guys can tell us when will you be implementing it, we can plan things accordingly.

Thank you.

Untill there is an official update on this, you can use admob_flutter
package v 0.2.0.

Thanks,

Purusothaman Ramanujam

On Mon, 13 May, 2019, 10:03 PM Dark Chocolate, notifications@github.com
wrote:

I am just not able to update my flutter app because of this, if you guys
can tell us when will you be implementing it, we can plan things
accordingly.

Thank you.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/12114?email_source=notifications&email_token=AAIHDZ245EMJ2W2HX6MIHDDPVGJ7JA5CNFSM4D3FBARKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVI3QJI#issuecomment-491894821,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAIHDZYX4MEYBTZTHKDQQFDPVGJ7JANCNFSM4D3FBARA
.

The only tricky part re admob_flutter is lack of iOS support. Other than that, it is far better than this one.

@angel1st This thread is for native ads and even admob_flutter doesn't support it.

@SachinGanesh - there are serious CPM concerns with FAN.

Minor rant that does not add anything technical to this discussion - For me is strange that Google does not support its top revenue earning product (advertising) on what is supposed to be its hottest framework for developers. There is a disconnect in the force. :)

Check out https://github.com/dreamsoftin/facebook_audience_network. It supports native ads.

@SachinGanesh Is support for native ads possible on iOS?

Checking in. Please make this plugin better!

we all need this😁😁

This plugin is updated to support iOS as well to show inline admob ads but native ads not supported yet. https://pub.dev/packages/admob_flutter

I work for a very large publisher with a reach of millions of readers daily (_I have spoken with various members of the Flutter Team and they know the publisher which I refer to_). We have an MVP Flutter app, which is fine to release with basic firebase_admob, but we are looking at creating another app which will require DFP ads, and the lack of support for native ads is a blocker. This is disappointing as we have invested resources into the Flutter and are held back by possibly the most important aspect for a lot of app developers. POI: Most of our Ad partners use HTML views and JavaScript inside WebViews.

Reading through some of the posts made above in this thread is it clear that many have attempted to resolve this issue in similar ways to our own development team, but these are approaches do not satisfy ad-network requirements, their own fraud-detection techniques and it is fundamentally something that needs to be addressed by the Flutter team.

I would like to stress that is is very important to elevate this issue as it will ultimately have an effect on the adoption of Flutter in businesses where ads are an important channel of income.

Examples of ads we are required to show include ones similar to these:
https://vimeo.com/186510665

Update:

Some further background, when testing our example with Teads, the ad is displayed and the embedded video plays, however the log shows an issue with correct viewability tracking:
Teads: W/teads#Visibility(17978): The Teads AdView is visible at 0%, hidded by 1 View(s): W/teads#Visibility(17978): - View of class io.flutter.plugin.platform.SingleViewPresentation$FakeWindowViewGroup, with id: -1, with contentDescription: null, with a size of: [width: 1050, height: 875] is hidding 100% of the ad

Check out https://github.com/dreamsoftin/facebook_audience_network. It supports native ads.

@SachinGanesh Is support for native ads possible on iOS?

Yes. It is possible with the UiKitView widget. But native ads for iOS are not yet implemented in facebook_audience_network

I work with @nodinosaur and to add to his point, we have an upcoming project that would be great with Flutter but no movement on DFP / ads would imply no flutter.

I am the founder of the largest social network in my country, with 15 million active users. I decided to migrate to Flutter, and when I finished the application, I realized that I would not be able to monetize it. I will not ruin the user experience with banner and intertistial. Native ADS is a must-have application today because it allows you to monetize it without being aggressive.
4 months of lost work, I'm going back to Swift + Kotlin.

@jonataslaw thank you for your feedback. Native DFP ads work. Some publishers like Teads use their own visibility detection code. I believe I have resolved this.

The related code is https://github.com/flutter/engine/blob/master/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java

As explained at the top of the code:

/*
 * A presentation used for hosting a single Android view in a virtual display.
 *
 * This presentation overrides the WindowManager's addView/removeView/updateViewLayout methods, such that views added
 * directly to the WindowManager are added as part of the presentation's view hierarchy (to fakeWindowViewGroup).
 *
 * The view hierarchy for the presentation is as following:
 *
 *          rootView
 *         /         \
 *        /           \
 *       /             \
 *   container       state.fakeWindowViewGroup
 *      |
 *   EmbeddedView
 */

This fakeWindowViewGroup is placed over the top of the EmbeddedView, even though its transparent Teads at least believes it is covering the entire view. The fakeWindowViewGroup is required so that when popup menus and panels are added they are positioned above the native view.

This however can actually be achieved slightly differently. The first view in fakeWindowViewGroup should be the container. This then makes the fakeWindowViewGroup the parent not a sibling. The addView/removeView/etc callbacks of the WindowManager can then just add and remove views as they do now, which places view's "on top" of the EmbeddedView because that is the standard drawing order in Android. Solving the issue that the fakeWindowViewGroup sibling is covering up the EmbeddedView.

/cc @amirh

I have tested my own local embedded view code, just for testing.

private void findAndHideFakeWindowManagerViewGroup()
{
    final ViewGroup parent = (ViewGroup) ((ViewGroup) getParent()).getParent();
    parent.getChildAt(1).setVisibility(View.INVISIBLE);
}

And this resolved the issue. So, if the platform SingleViewPresentation.java is adjusted to work like my previous comment suggested it will resolve the issue.

__This is not a solution.. it is a workaround. If your embedded-view tries to display a dialog or popup menu, or fullscreen view. It will not be displayed when using the above code. Please wait for the PR to be merged in__

PR is attached that should resolve the issue on Android. I do not know if the same issue exists on iOS. I am currently not able to build the engine to test it, so someone will need to run off a build. If the team can do this directly, we can then verify the custom engine build against the local ad-SDKs to verify the fix works.

Is there any progress on this feature or a timeline we can look forward to?

@RaresMihalcea it's set for the Future milestone (Due by January 01, 2033), which is somewhat disturbing, considering the importance of this feature. I suspect missing support for native admob ads is a game-changer for a lot of developers.

Reached a point where we've had to tell a client "We can do everything you need, Flutter is amazing, but we cannot do native ads on iOS." It feels insane that this isn't being considered a big deal when it's a deal breaker for some coming to this framework. Google plz!

Checking in. Any updates?

So I've been looking at alternative tech stacks I can use for my project which must have native ads.
I found out that there's no support for react-native and ionic or a realistic timeline for those either.
Could it be that native ads are just for native tech ba dum tss?
Unfortunately, it seems that I'll have to learn Kotlin and download a Mac OS VM to actually work on my pet project because I am tired of being unable to start it for months.

P.S. if anyone knows a module for Ionic or React-Native that actually allows for native ads use I'd be really grateful!

Altough native ads would be ideal, seeing that native admob ads are still in beta even for native app development, in the meantime I'd be happy if they could just fix this in their firebase_admob plugin which has the following limitations:

"Banner ads have limited positioning functionality. They can be positioned at the top or the bottom of the screen and at a logical pixel offset from the edge."

If they could fix that atleast we all could show ads in a "native" kind of way where users can scroll by them etc.

I know there are other plugins that try to solve this but they are buggy, especially for iOS. Would be great if was part of the flutter backed plugin called "firebase_admob".

Flutter is awesome, but I will not wait until January 01, 2033 to have native ads. That's funny, it's really funny, it's 2019, and to have such a relevant role, we'll have to wait for our grandchildren to be born (in 2033 there may not even be "Android" and "IOS" technology has renewed every decade) have native ads.

Thanks everybody for providing your feedback.

There are multiple features and potential solutions discussed in this thread, I'm splitting this to multiple issues to better understand the community demand, please add your thumb up to the issue/s you care about.

Supporting Native Ads Advanced by embedding a platform specific native ad UI as part of the widget tree

The term "native ads" used in the current issue refers to a specific AdMob ad format called "Native Ads", which is currently available to a limited set of app developers(publishers). The Native Ads format allows developers to customize the way ads are rendered (by building their own Android/iOS views for the ad).

The feature discussed here will mean app developers will use Android/iOS UI components (not Flutter widgets) to configure how the ad is rendered, and the native ad will later be embedded in the Flutter widget tree as rendered by the platform.

This is what we're tracking in the current issue.

Embedding AdMob banner ads in a Flutter widget tree

An additional feature that is discussed in this issue is the ability to embed an AdMob banner ad as part of the Flutter widget tree (vs. the current approach taken by the firebase_admob plugin which is to overlay the banner ad on top of the Flutter UI in a pre-set position).

This is tracked in https://github.com/flutter/flutter/issues/35081, please add your thumb up if you care about this.

Supporting Native Ads Advanced by overlaying platform-specific native ad UI on top of the Flutter UI

This will give roughly the same functionality as the current banner support in the firebase_admob plugin but with native ads (e.g., a native ad appears in a fixed position, floating over the entire Flutter UI).

While being able to embed native ads is obviously the better option, this "floating" approach that's similar to the current banner support is something reasonable to expect within a shorter time frame.

Please add your thumb up to https://github.com/flutter/flutter/issues/35082 if this option will help you.

Supporting Native Ads Advanced with Flutter rendering

This means you will use Flutter widgets to render the native ad, similar to how you'd do it if you were developing for native Android/iOS.

Note that this option is probably the most difficult to achieve and is still far out in the future.

This is tracked in https://github.com/flutter/flutter/issues/35083

Altough native ads would be ideal, seeing that native admob ads are still in beta even for native app development, in the meantime I'd be happy if they could just fix this in their firebase_admob plugin which has the following limitations:

"Banner ads have limited positioning functionality. They can be positioned at the top or the bottom of the screen and at a logical pixel offset from the edge."

If they could fix that atleast we all could show ads in a "native" kind of way where users can scroll by them etc.

I know there are other plugins that try to solve this but they are buggy, especially for iOS. Would be great if was part of the flutter backed plugin called "firebase_admob".

@matte5031 I tried 'https://pub.dev/packages/admob_flutter' with Android test Ads and so far I am thrilled the way Ads can be Added below Scaffold, into List view and solved most of the challenges i faced with not just other flutter admob plugins also with tech stack of react.js and Apace cordova. However I am just testing with AdMob test Ads and not confirmed about it in the production.

@ashishsukhija Ye I know the android test ad worked for me aswell, but the iOS did not. Therefor I would much rather prefer this to be included by the google maintaned plugin that already exists but lacks this atm

Supporting Native Ads Advanced by embedding a platform specific native ad UI as part of the widget tree

This is already possible in Flutter with Platform Views (Android View/UIKitView). We have implemented native ads in Facebook Audience Network plugin. This also means that any Ad SDK with native ads can be easily added to flutter app and it can be shown within the widget tree.

Here is an example of how Native Ad looks in our production app:
Webp net-resizeimage

@SachinGanesh Your plugin only supports Android. UIKitView has major limitations, such as the inability to be clipped (#25965) , which have to be resolved before we can call this a reliable method. There are also significant performance problems with using this method currently.

@JaspervanRiet Is there any need to clip the native ads UI. Correct me If I am wrong, It will take the maximum width bases on the container right?

@FarmaanElahi The need for clipping is not just because it would be useful to clip the actual widget, it's also because the lack of support for it means that currently, UIKitViews clip through UI elements. If you put a UIKitView with an ad in a list, that view will clip through a TabBar. That means that for our project, it is unusable as a way to display ads.

@SachinGanesh The plugin is great and honestly the best we have at the moment in terms of native ads.
I am finally able to at least write the code for my UI with all its elements. Could you please post a roadmap of how you want to improve the plugin on its GitHub page? I am curious about when the IOS support will come out.

Note that because Flutter's AndroidView and UiKitView rely on low-level manipulation of platform UI components, it's almost guaranteed that they will interact with the Google Mobile Ads SDK in ways the mobile ads engineering team have not anticipated and do not test for. Even if the approach looks like it's working right now, it's likely to run into issues with MRAID functionality, JS code included in the creatives, and impression and click measurement. The last of those is particularly important, since abnormalities in impression and click stats can result in suspension of accounts.

While we work on these issues with the relevant parties we highly recommend using the Flutter team's firebase_admob plugin, and discourage using plugins that do use platform views to embed AdMob ads.

Thanks for the info @amirh <3

This is an absolute must for Flutter to be a viable choice for free apps.

Can we get the Admob team to see if using AndroidView and UiKitView is a valid solution? If it isn't, as @amirh explains above, what is an alternative solution?

@charleshan see https://github.com/flutter/flutter/issues/12114#issuecomment-505633342 for issues that track different solutions (and hopefully their resolution soon, fingers crossed).

The verified Twitter account for Google Admob announced that native ads are going to be available to all devs. Thought this thread might want to know about it :).
image

How is it going?

Thanks everybody for providing your feedback.

There are multiple features and potential solutions discussed in this thread, I'm splitting this to multiple issues to better understand the community demand, please add your thumb up to the issue/s you care about.

Supporting Native Ads Advanced by embedding a platform specific native ad UI as part of the widget tree

The term "native ads" used in the current issue refers to a specific AdMob ad format called "Native Ads", which is currently available to a limited set of app developers(publishers). The Native Ads format allows developers to customize the way ads are rendered (by building their own Android/iOS views for the ad).

The feature discussed here will mean app developers will use Android/iOS UI components (not Flutter widgets) to configure how the ad is rendered, and the native ad will later be embedded in the Flutter widget tree as rendered by the platform.

_This is what we're tracking in the current issue._

Embedding AdMob banner ads in a Flutter widget tree

An additional feature that is discussed in this issue is the ability to embed an AdMob banner ad as part of the Flutter widget tree (vs. the current approach taken by the firebase_admob plugin which is to overlay the banner ad on top of the Flutter UI in a pre-set position).

_This is tracked in #35081, please add your thumb up if you care about this._

Supporting Native Ads Advanced by overlaying platform-specific native ad UI on top of the Flutter UI

This will give roughly the same functionality as the current banner support in the firebase_admob plugin but with native ads (e.g., a native ad appears in a fixed position, floating over the entire Flutter UI).

While being able to embed native ads is obviously the better option, this "floating" approach that's similar to the current banner support is something reasonable to expect within a shorter time frame.

_Please add your thumb up to #35082 if this option will help you._

Supporting Native Ads Advanced with Flutter rendering

This means you will use Flutter widgets to render the native ad, similar to how you'd do it if you were developing for native Android/iOS.

Note that this option is probably the most difficult to achieve and is still far out in the future.

_This is tracked in #35083_

I have been following this thread for a while and managed to miss this request to vote for features. Not sure how much the voting helps as this issue has been one of the top voted for almost 18 months now and we have no indication of any progress.

I remember someone sharing this here a couple of weeks ago but it looks like he/she deleted the post.

Everyone here should complete the quarterly survey from the Flutter Team: https://twitter.com/flutterdev/status/1160961757118181378

More specifically this part:
image

I remember someone sharing this here a couple of weeks ago but it looks like he/she deleted the post.

Everyone here should complete the quarterly survey from the Flutter Team: https://twitter.com/flutterdev/status/1160961757118181378

More specifically this part:
image

Survey is no longer active.

Any News about the native part ?

It doesn't seem like this problem will be solved any time soon. Perhaps someone from the Flutter team/Google can reach out to the Admob folks to see if there anything that could be done from their side. I'm wondering how native ads work Unity.
https://developers.google.com/admob/unity/custom-native

If that's not an option can we think of an alternative solution for the time being? We'd like to monetize free apps in a non-intrusive way so how about some kind of an affiliate program service (CJ affiliate)? Also, anyone have recommendations of an open source adtech that we can use?

@charleshan - this one seems to be a dead opportunity. Consider using ad manager and the associated flutter_ad_manager widget. You can add a fair few standard banner creatives in there and create multiple widgets in your app.

All Firebase plugins are moved from https://github.com/flutter/plugins to https://github.com/FirebaseExtended/flutterfire.
Does it mean that current issue is out of date? It seems we have to open new issue there.

I'd keep an issue here anyway as we may potentially need framework/engine changes to support this fully.

This looks promising: https://pub.dev/packages/native_ads. We were able to get native test ads working on Android. Haven't tested in iOS yet. You need to add native_ad_layout.xml to the android/app/src/res/layout directory and change the packageName to your applicationId.

Look like some progress is being made 🙌

https://github.com/FirebaseExtended/flutterfire/pull/169

@sethladd

This issue has been moved to https://github.com/FirebaseExtended/flutterfire/issues/968. Any further collaboration will be done there.

Since firebase_admob issues require work on the Flutter side as well as the plugin side these issues will remain open here as well until resolved.

I also need this to monetize an app that relies heavily on user submitted data. I really need a non intrusive way to display ad mob banner inline with content. Thanks for the efforts.

I havent been able to get any of this working for months. Do we know if it will work no problem with iOS on the meantime?

Any updates for this?

Hi there is a package called native_ads which support native ads from google admob . I didn't tried it yet but it's just a Suggetstion .

A quick caveat about native_ads and any other plugins that attempt to use Flutter's PlatformView widgets to display ads:

While it's great to see folks in the community working on these types of things, everyone should be aware that just getting an ad onscreen is only part of the job for any mobile ads plugin. In addition to display, ads need to track impressions, handle clicks, deal with things like MRAID, AdChoices placement, anti-spam features, and accurate measurement of a whole bunch of signals.

The reason there isn't already a plugin from Google for native ads is that it's very hard to get all of that right, and the consequences of not getting it right could be lost revenue, inaccurate stats, and even account suspension by AdMob or any mediated ad network.

For that reason, I highly recommend sticking with the firebase_admob plugin for now. While that plugin doesn't include native ads, the formats it does support are known to be implemented correctly.

There are engineers at Google working to build a better ads integration, but it's still an ongoing project right now.

A quick caveat about native_ads and any other plugins that attempt to use Flutter's PlatformView widgets to display ads:

While it's great to see folks in the community working on these types of things, everyone should be aware that just getting an ad onscreen is only part of the job for any mobile ads plugin. In addition to display, ads need to track impressions, handle clicks, deal with things like MRAID, AdChoices placement, anti-spam features, and accurate measurement of a whole bunch of signals.

The reason there isn't already a plugin from Google for native ads is that it's very hard to get all of that right, and the consequences of not getting it right could be lost revenue, inaccurate stats, and even account suspension by AdMob or any mediated ad network.

For that reason, I highly recommend sticking with the firebase_admob plugin for now. While that plugin doesn't include native ads, the formats it _does_ support are known to be implemented correctly.

There are engineers at Google working to build a better ads integration, but it's still an ongoing project right now.

Okay thanks for explaining !

A quick caveat about native_ads and any other plugins that attempt to use Flutter's PlatformView widgets to display ads:

While it's great to see folks in the community working on these types of things, everyone should be aware that just getting an ad onscreen is only part of the job for any mobile ads plugin. In addition to display, ads need to track impressions, handle clicks, deal with things like MRAID, AdChoices placement, anti-spam features, and accurate measurement of a whole bunch of signals.

The reason there isn't already a plugin from Google for native ads is that it's very hard to get all of that right, and the consequences of not getting it right could be lost revenue, inaccurate stats, and even account suspension by AdMob or any mediated ad network.

For that reason, I highly recommend sticking with the firebase_admob plugin for now. While that plugin doesn't include native ads, the formats it _does_ support are known to be implemented correctly.

There are engineers at Google working to build a better ads integration, but it's still an ongoing project right now.

Isn't the Mobile Ads SDK responsible for tracking impressions, handling clicks, anti-spam features, and accurate measurement of a whole bunch of signals. How is this different that if we were building a native android app and following the instructions here: https://developers.google.com/admob/android/native/start

A quick caveat about native_ads and any other plugins that attempt to use Flutter's PlatformView widgets to display ads:
While it's great to see folks in the community working on these types of things, everyone should be aware that just getting an ad onscreen is only part of the job for any mobile ads plugin. In addition to display, ads need to track impressions, handle clicks, deal with things like MRAID, AdChoices placement, anti-spam features, and accurate measurement of a whole bunch of signals.
The reason there isn't already a plugin from Google for native ads is that it's very hard to get all of that right, and the consequences of not getting it right could be lost revenue, inaccurate stats, and even account suspension by AdMob or any mediated ad network.
For that reason, I highly recommend sticking with the firebase_admob plugin for now. While that plugin doesn't include native ads, the formats it _does_ support are known to be implemented correctly.
There are engineers at Google working to build a better ads integration, but it's still an ongoing project right now.

Isn't the Mobile Ads SDK responsible for tracking impressions, handling clicks, anti-spam features, and accurate measurement of a whole bunch of signals. How is this different that if we were building a native android app and following the instructions here: https://developers.google.com/admob/android/native/start

The thing is that platform view might have side-effects and behave differently than the same ads viewed directly on the native platforms.
For example, if the ad visibility is counted when the percentage of view is shown for a specific period of time.
Are not 100% sure that the 1st pixel of the ad appears and is counted in the same way in native and futter?

Using ads in a not intended environment might cause google to have objections. Especially that it directly impacts their business model.

It's at least a grey zone.

Another way to say it is that any plugin made for Flutter to display mobile ads must be able guarantee that it doesn't interfere with the ad SDK's ability to do its job, which is a tricky thing to do. Add to that the pressure that comes with working on a plugin that could literally be responsible for someone's livelihood, and youcan see how important it is to get the plugin rock solid before releasing it.

These are all fair points about a third party native ads plugin. As soon as we have a better solution from Google we'll update our app.

I've been working on a news feed app and I really need to place native ads blended into posts. So, most probably I should go with add-to-app rather than plugin approach, so the listing screen is implemented in Swift/Kotlin to deal with ads, the rest of screens that do not have ads can be implemented in Flutter.

I would like to point out that the flutter_admob plugin is currently implementing at least one discouraged banner implementation by the Admob Policies.

I believe it's implementing "Ad overlapping with app content" and, in most of the Android cases the "Ad sandwiched between app items". You can find the related information here.

That being said, I'm not sure what is worst, if to be in a "grey zone" as mentioned above or directly implementing something that is stated as "against policy" in the Admob policies page itself 🤔

I believe we should have at the very least get a progress report of the current progress. In this day of competitive applications, it would be great to at least keep up with the competition.

A banner overlay on screen looks _very disgusting_ especially when paired with the beautiful flutter UI/UX.

Till we have a robust solution for monetizing apps with ads, I'm afraid it will be a big reason for smaller app developers to shun Flutter. It's one thing to make a lightweight app as a proof of concept but without the hooks to bring in consistent ad revenue, it's just a nice shiny tool with limited use cases in the real world. Waiting for nearly two years for this to get prioritized.

It looks like native ads have been added a few days ago: https://github.com/FirebaseExtended/flutterfire/pull/169

It looks like native ads have been added a few days ago: FirebaseExtended/flutterfire#169

It's really nice that they did add this. Great job guys!
However, still, you cannot position it inside your view hierarchy.
To my understanding, there is only show method that pops up the view from the bottom as an overlay.

I have MainActivity.kt and not MainActivity.java;

Can I use Native Ads? How to?

It looks like it's just Android?

It looks like it's just Android?

It looks like native ads on IOS have been added as well https://github.com/FirebaseExtended/flutterfire/pull/2106

But can you place it inside your view hierarchy?

It seems there is only show method that pops up the view from the bottom as an overlay, which makes it pretty useless as a native ad.

I figured that was the whole point of this, otherwise it's just as useless.

Any progress on this?

Can confirm, it's literally just a banner ad right now with customizability from android layouts only.

I don't really get how the current implementation handles the display of ad views, if it's not using platform views.

Does it display native a Android View / iOS UIView on top of the flutter view?
Create a new Activity for interstitials?

Could someone please point me to where this is done in the code?

It overlays the ads on top of flutter widget. Ads aren't part of flutter
widget hierarchy So you will not be able to embed that in a widget. Example
a list view

On Thu, Apr 30, 2020, 10:32 PM dasebasto notifications@github.com wrote:

I don't really get how the current implementation handles the display of
ad views, if it's not using platform views.

Does it display native Android Views / iOS UIView above the flutter view?

Could someone please point me to where this is done in the code?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/12114#issuecomment-621980272,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AESIMECDHHOREM7OCD6UC63RPGVIVANCNFSM4D3FBARA
.

If that’s really the case then what’s the point of all this?

The most common and natural place for a Native Ad to be is inside a list view, if that’s not possible what value does it add?

Exactly, the whole point is embedding them and customizing them in the widget tree. So they can fit in with the app's style. That is literally the whole point of a native ad.

Any progress on this?

Not just native ads, also banner ads should be integrated into widget tree. After a short usage of this widget I realised how difficult it is to work with floating banners in app. They interfere with lots of visual elements in the app, menus, list views, bottom dialogs and surfaces on iOS etc. etc. They are just not suitable for some kind of applications. Normal widget banners is what we need.

consider adsense for flutter web too

On one hand the Flutter team says that they prioritize issues according to the number of thumbs up they receive (this issue is currently ranked 4th on the entire repo) and on the other hand this issue is labeled as P6, meaning "A feature or bug we're unlikely to address".
Providing an easy and seamless way to monetize mobile apps via ads is a basic feature for any framework, yet it doesn't seem like this is the case with Flutter.

@kf6gpe can you please shed some light on this?

I would observe the project attached to this ticket.
The "Ecosystem - Bitcoin" does contain plenty of "stuff" for PlatformViews which might explain why we are not getting dart implementation of the ads.

Does the Flutter team want to first improve (functionality and performance) of PlatformViews to then just use the native ad SDKs without rewriting them?

Nevertheless, more transparency would be greatly appreciated.

Guys, what are we doing? This is basically a cat 1 bug as far as most people are concerned. It is looking like a complete showstopper for my application and I am considering other cross-platform frameworks after reading all day about how this feature has been in the works for 3+ years without any significant progress. I don't consider the ability to display native ads as glorified banners as progress. We must have embedded native ads or at the very least the ability to overlay native ads on flutter widgets, otherwise there is simply no incentive to continue with what is otherwise a fantastic platform.

I know this isn’t exactly what we want, it’s not Admob native ads, but it works, so you might find it useful.

There’s a package for Facebook Audience Network native ads and it’s working great, tested both on Android and iOS.

https://pub.dev/packages/facebook_audience_network

@jebwatson - have a look at this one https://pub.dev/packages/admob_flutter. I cannot find a better option so far with regards to AdMob & Flutter implementation.

I'm still waiting for this as well. I just want to display AdMob banner inline with my flutter views. Floating the banner over the top of the flutter app is just ugly and undermines the entire purpose of this platform.

We've been using https://pub.dev/packages/native_ads

tidewatch

My concern would be that this is a grey-zone.
There is a possibility google might block applications that use Ad solutions which are not designed for them.

Right now the only solution available that the Third party libraries use to display native ads as part of flutter widget tree (eg: ListView) is to embed native Android and iOS view using AndroidView and UiKitView respectively which according to the Flutter Docs is an expensive operation and should be avoided and as a result there is a significant lag while scrolling.

Is this the reason the flutter team are delaying native ads implementation as part of the flutter widget tree because they are waiting for a better and faster way to embed native views in flutter or some other improvements?

But, wouldn't it be possible to implement admob (native ads) completely in flutter/dart without depending on Android and iOS?

Desperate to have native ads support in flutter listviews. Any sort of timeline about when we are able to use native ads in flutter by the team will be helpful.

There are so many third-party plugins that implement native ads by AdMob. Knowing the notoriety of Google for banning the developers for trivial issues, I am afraid to use those solutions. I am looking forward to the first-party implementation of this. Could you please give a timeline?

We have good news for you all, with today's announcement of beta support for this feature:
Support for inline banner and native ads formats in Flutter

Right now this is in a closed beta, but we strongly encourage you to apply to join if you're ready to use this feature in a production app. Assuming all goes well, we plan to open this up more broadly in early 2021.

We have good news for you all, with today's announcement of beta support for this feature:
Support for inline banner and native ads formats in Flutter

Right now this is in a closed beta, but we strongly encourage you to apply to join if you're ready to use this feature in a production app. Assuming all goes well, we plan to open this up more broadly in early 2021.

This is awesome ❤️. Been a few days since I applied for the beta program. Waiting eagerly for a reply ✨

@timsneath
I'm very glad of this effort to make flutter app easy to monetize w/o depending from firebase

I also hope that the same effort will be dedicated into
making _flutter web_ seo friendly first and to add support to adSense then
to have some _parity_ between all flutter's supported platforms

I also applied for the beta program. Has anyone received a response?

Was this page helpful?
0 / 5 - 0 ratings