MTAdmob version 1.9 is here

Finally the new version of my Google Admob plugin for Android and iOS is available on nuget.

To facilitate the migration of apps from Xamarin to MAUI, I’ve done several changes to the plugin so that the transition to MAUI will be as easy as possible (probably just few minutes will be enough).

There are some changes to do to your project to update the plugin to version 1.9 but it’s worth it.

Let’s see what are the changes in the new version:

  • Added support for different Banner sies
  • Added possibility to automatically resize the ads
  • Added rewarded interstitials
  • Fixed several bugs

Not bad, isn’t it?

Ok, now in details, let’s see how to use the new functionalities.

Banner sizes

Version 1.9 of MTAdmob adds support for different Banner sizes.

Google supports the following sizes:

  • Banner,
  • LargeBanner,
  • MediumRectangle,
  • FullBanner,
  • Leaderboard,
  • AnchoredAdaptive,
  • InlineAdaptive,
  • Smart*

* Smart banners are now deprecated so they might be stopped any time soon.

To select your preferred size, use the property AdSize. As an example you can include a banner in you XAML with the following code:

<controls:MTAdView AdSize="FullBanner" AdsId="YOUR ADS ID"/>

It couldn’t be easier! One line of code and you have a wonderful banner in your Xamarin app for Android and iOS.

AutoSize

Let’s have a look at the next great thing: Automatic resize for your Banners.

In MTAdmob version 1.9 I’ve added a new property called AutoSize. If you set this boolean property to true, the plugin will try to resize the banner view according to the Banner type and loaded ads. If you set the property to false, you can manually resize your banner.

Rewarded interstitial

Rewarded interstitial is a type of incentivized ad format that allows you offer rewards for ads that appear automatically during natural app transitions. Unlike rewarded ads, users aren’t required to opt-in to view a rewarded interstitial.

Interested? Then lets’ see how to use them.

First of all, to load a rewarded interstitial use the following command:

CrossMTAdmob.Current.LoadRewardedInterstitial("YOUR ADS ID");

To check if the ads is loaded, use the following command:

CrossMTAdmob.Current.IsRewardedInterstitialLoaded()

And finally, once the ads is loaded you can show it using the following command:

CrossMTAdmob.Current.ShowRewardedInterstitial();

Easy? Of course it is: 3 lines and you have your rewarded interstitials.

Links

The package is available on: https://www.nuget.org/packages/MarcTron.Admob

Support

I’m really happy and proud to provide this library for free and to support and maintain it and I’m incredibly happy to know that this library will save you days and days of development. If possible I ask you to support my work. Your support will help me to continue to maintain this project and its porting to MAUI. To do so, you can click the following button:

Conclusion

Do you have any questions? Leave a comment and I’ll reply as soon as possible.

Now, Enjoy the plugin!