How to adding native elements ?

Hello, I need some help for understand how I can add some native elements to fuse. It’s my first foreign code so sorry if my question is maybe basic.
(I wish add AdMob to my app)

I don’t have any idea how I can add something like that in fuse.



    AdView mAdView = (AdView) findViewById(;

I have read the doc about native ux components but I’m still stuck.

Someone can give me a small example? Or give me a link that explains how I can do it.

Thank’s in advance.

I’m trying to do the same, like you I also have read the docs but can’t find the way to do it. It’s a bit frustrating because apparently only a few lines are needed to implement AdMob. Maybe someone from the team could help us?

Hello aTo and Juanlu!

Can you explain what you tried and where you are stuck? The docs you linked to should be what you need.

If I’m reading your post right it also looks like you need to add some elements to the AndroidManifest.xml. For that I suggest you look at the examples on using third-party SDKs where we do that.

Cheers, Olle


Ideally I wish create a module for AdMob. But right now I’m just trying to create a blank app with ad. (Step by step ^^)

( According to the “Get Started” from AdMob I don’t see anything about the AndroidManifest.xml. You made reference to what? Adding google-services.json?

I have post my “work” on github ( if you want see. I really don’t know if I’m on the right way, but for know I don’t have any error when I build (uno --target=Android -DGRALE).

Now(if right way) I need found a way to display my mAdView.

I’m trying to understand how work the NativePickers on your github and follow the tutorial “Custom native control” on the doc.

Sadly when I try to build I have the same error that this post. (

So if someone can check my code and tell me if it’s look good or not. And some tips for the next.



I read your code and I see that you inherit from NativeModule which is a base class for exposing Uno functions and events in JavaScript.

I have written a piece of code that I hope should get you started in integrating your native UI in fuse:

using Uno;
using Uno.UX;
using Uno.Compiler.ExportTargetInterop;

using Fuse;
using Fuse.Controls;

public class AdMob : Panel
    protected override IView CreateNativeView()
        if defined(Android)
            return new Android.AdMobView();
        else if defined(iOS)
            throw new NotImplementedException();
            return base.CreateNativeView();

namespace Android
    using Fuse.Controls.Native.Android;

    extern(Android) public class AdMobView { }

    extern(Android) public class AdMobView : LeafView

        static AdMobView()

        public AdMobView() : base(Create())


        static Java.Object Create()
            AdRequest adRequest = new AdRequest.Builder()

            AdView mAdView = new AdView(Activity.getRootActivity());
            return mAdView;

        static void Initialize()
            MobileAds.initialize(Activity.getRootActivity(), "ca-app-pub-3940256099942544~3347511713");


We have fixed the Native UI tutorial, just waiting for it to be published. Let me know if you have any further questions

Hello Vegard Strand Lende!

Thank’s for your piece of code. I worked this weekend and I managed to create some code (which is very similar) for display a Ad !

But your seems cleaner so I have edit my code.

I have just remove extern(Android) public class AdMobView { } because it’s generate a error E2047: No implicit cast from Native.Android.AdMobView to Fuse.Controls.Native.IView

It’s working fine ! Thank’s !

Edit: Now I will try to add some parameter to change another size/UnitID from ux!

aTo, can you please share the code to display an ad? I created a code based on Vegard’s piece of code, apparently everything is ok, I build the android app with no errors but when the app runs on the device I got the following message on the console:

FirebaseApp initialization unsuccessful.

Obviously no ad is shown. You had this error? You know how to fix it?

I have update my github. (

If you need more info come to and pm me. (ato)