AdMob Plugin for Xamarin.Forms


While working on our app Braino Challenge , we decided to use Xamarin forms all the way.

One of the cool things when using Xamarin, is the huge amount of nuget packages available, but xamarin forms stills lacks some useful plugins. For example, in our journey to forms, we had to develop a plugin to serve admob ads. The ios nuget package exists, the android one exists too, but what was missing when we started the project was a working abstraction usable in forms with respective implementations.

Our admob plugin is the first one of a serie we are publishing on Github and Nuget to make the life easier to the Xamarin community when it comes to develop forms applications.

How to use it ?

First, download the nuget package we published.

Screen Shot 2016-02-17 at 10.44.56 AM

Then initialise the plugin in your AppDelegate.cs for iOS of MainActivity for android.

//Register AdBanner Control Renderer
AdBannerRenderer.Init ();
//Initialize Interstitial Manager with a Specific AdMob Key
CrossAdmobManager.Init (Strings.AdMobKey);

To display an interstitial, all you have to do is :

await CrossAdmobManager.Current.Show ();

To display a banner view, all you have to do is :

var myBanner = new AdBanner();
//Set Your AdMob Key
myBanner.AdID = Strings.AdMobKey;

What’s next ?

We are currently preparing release both on github and nuget for several plugins we developed for Braino Challenge, so stay tuned !