-
Notifications
You must be signed in to change notification settings - Fork 7
Banner ads
Marius Bughiu edited this page Feb 2, 2025
·
7 revisions
Add the controls namespace at the top of your page:
xmlns:admob="clr-namespace:Plugin.AdMob;assembly=Plugin.AdMob"
and then place the banner in your page.
<admob:BannerAd AdUnitId="ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx" />
Note
The AdUnitId
is optional when using test ads. You can enable test ads by setting AdConfig.UseTestAdUnitIds
to true
.
AdSize | Width | Height |
---|---|---|
SmartBanner | Screen width | 32/50/90 |
Banner | 320 | 50 |
LargeBanner | 320 | 100 |
MediumRectangle | 300 | 250 |
FullBanner | 468 | 60 |
Leaderboard | 728 | 90 |
Custom | * | * |
You can also create banners with custom sized by specyfing AdSize="Custom"
in combination with CustomAdWidth
and CustomAdHeight
. For example:
<admob:BannerAd AdSize="Custom" CustomAdWidth="200" CustomAdHeight="200" />