I want to integrate Google Ads in my app but im stuck when it's time to load the request and get the Ad.
I'm trying to load a SearRequest for displaying a SearchBannerView but not methods seems to match my needs, the LoadRequest methods of the SearchBannerView doesn't accept SearchRequest only Request and no cast exists between those two classes.
However the google docs says it's possible : https://developers.google.com/mobile-ads-sdk/docs/search-ads-for-apps/ios/
Here is my code :
this.banner = new SearchBannerView(AdSizeCons.Banner, new CGPoint(0, 0)); this.banner.TranslatesAutoresizingMaskIntoConstraints = false; this.banner.AdSize = AdSizeCons.Banner; this.banner.AdUnitID = this.AdService.AdMobUnitId; this.banner.AdReceived += this.AdReceived; this.banner.RootViewController = UIApplication.SharedApplication.KeyWindow.RootViewController; var request = new SearchRequest(); request.Query = ((GoogleAdViewModel)this.DataContext).Query; // my request isn't accepted this.banner.LoadRequest(request);
Anyone has succeed to make SearBannerView load something using the Google Ads component of Xamarin ?
FYI it's for an iOS app and i'm using this component : https://components.xamarin.com/view/googleiosmobileads.