Jc.AdMob.Avalonia.iOS
1.0.0
See the version list below for details.
dotnet add package Jc.AdMob.Avalonia.iOS --version 1.0.0
NuGet\Install-Package Jc.AdMob.Avalonia.iOS -Version 1.0.0
<PackageReference Include="Jc.AdMob.Avalonia.iOS" Version="1.0.0" />
paket add Jc.AdMob.Avalonia.iOS --version 1.0.0
#r "nuget: Jc.AdMob.Avalonia.iOS, 1.0.0"
// Install Jc.AdMob.Avalonia.iOS as a Cake Addin #addin nuget:?package=Jc.AdMob.Avalonia.iOS&version=1.0.0 // Install Jc.AdMob.Avalonia.iOS as a Cake Tool #tool nuget:?package=Jc.AdMob.Avalonia.iOS&version=1.0.0
<h1 align="center"> <br> Jc.AdMob.Avalonia <br> </h1> <h4 align="center"> Library to bring AdMob advertisements to Avalonia mobile projects. </h4> <h6 align="center"> Avalonia solution derived from <a href="https://github.com/marius-bughiu/Plugin.AdMob/tree/main">marius-bughiu/Plugin.AdMob</a> </h6> <hr>
Table of Contents
Introduction
Jc.AdMob.Avalonia is a library to bring Google AdMob services to Avalonia Android and iOS projects.
The library currently supports the following ad units:
Banner | Interstitial | Rewarded interstitial | Rewarded | Native advanced | App open | ||
---|---|---|---|---|---|---|---|
Android | ✓ | ☓ | ☓ | ☓ | ☓ | ☓ | ☓ |
iOS | ✓ | ☓ | ☓ | ☓ | ☓ | ☓ | ☓ |
Usage
To use Jc.AdMob.Avalonia you must add the Jc.AdMob.Avalonia
pacakge to your cross-platform project.
dotnet add package Jc.AdMob.Avalonia
Followed by adding the Android/iOS Jc.AdMob.Avalonia.xxx
package to the platform specific project(s).
dotnet add package Jc.AdMob.Avalonia.Android
dotnet add package Jc.AdMob.Avalonia.iOS
Then you must register AdMob in the CustomizeAppBuilder
method in MainActivity.cs
and AppDelete.cs
for Android and iOS respectively:
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
...
.UseAdMob();
}
Banners
The BannerAd
control can be added to your XAML like so:
...
xmlns:admob="https://github.com/jc-admob-avalonia"
...
<admob:BannerAd UnitId="{ADMOB_UNIT_ID}" />
Sizes
The banner can be configured with the following sizes:
AdSize | Size |
---|---|
Banner | Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels). |
FullBanner | Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). |
Invalid | An invalid AdSize that will cause the ad request to fail immediately. |
LargeBanner | Large banner ad size (320x100 density-independent pixels). |
Leaderboard | Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). |
MediumRectangle | Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). |
WideSkyscrapper | IAB wide skyscraper ad size (160x600 density-independent pixels). |
Note: If the size is left unspecified, the banner will resize to fit the parent container.
Events
The banner exposes the following events:
Event | Notes |
---|---|
OnAdLoaded | |
OnAdFailedToLoad | |
OnAdImpression | |
OnAdClicked | |
OnAdOpened | |
OnAdClosed | |
OnAdSwiped | Android only |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-ios17.2 is compatible. |
-
net8.0-ios17.2
- Avalonia (>= 11.1.1)
- Avalonia.iOS (>= 11.1.1)
- Jc.AdMob.Avalonia (>= 1.0.0)
- Xamarin.Google.iOS.MobileAds (>= 8.13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.