1. If using local builder update to GoogleMobileAds v7.52: https://developers.google.com/admob/ios/download Don't update GoogleAppMeasurement.framework for now.
The hosted builders were updated.
2.
B4X:
#if OBJC
- (NSArray *)GetAdaptiveSize:(float)width {
GADAdSize g = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width);
CGSize s = g.size;
return @[[NSValue valueWithBytes: &g
objCType:@encode(GADAdSize)], @(s.width), @(s.height)];
}
#End If
3.
B4X:
'example of adding AdView in AppStart:
If Page1.RootPanel.Width = 0 Then
Wait For Page1_Resize (Width As Float, Height As Float)
End If
Dim no As NativeObject = Me
Dim sizes As List = no.RunMethod("GetAdaptiveSize:", Array(Page1.RootPanel.Width))
ad.Initialize("ad", "ca-app-pub-1267570815929340/4744679717", Page1, sizes.Get(0))
Dim w As Float = sizes.Get(1) 'ignore
Dim h As Float = sizes.Get(2)
Page1.RootPanel.AddView(ad, 0, 0, Page1.RootPanel.Width, h)
The Google Mobile Ads SDK returns an optimized ad height for the given width in a GADAdSize.
Anchored banner height is never larger than 15% of the device's height and never smaller than 50 points.
If you are using Firebase libraries then you will need to downgrade GoogleAppMeasurements framework. If you haven't encountered any error then it is probably fine.