私のアプリにGoogle Adsを統合したいのですが、リクエストを読み込んで広告を取得する時が来ました。Xamarin.iOS Google Ads Targeting
私が必要とするのは、ターゲットパラメータを渡して、ユーザーの検索に関連する広告を読み込むことです。
を表示するためにSearchRequest
をロードしようとしていますが、私のニーズに合った方法はありません。 SearchBannerView
のLoadRequest
のメソッドはSearchRequest
を受け付けません。それらはRequest
しか受け入れず、これら2つのクラスの間にキャストは存在しません。
ただし、元のGoogleドキュメントは、それが可能だと言う:ここでhttps://developers.google.com/mobile-ads-sdk/docs/search-ads-for-apps/ios/
は私のコードです:
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);
は、誰もがXamarinからGoogleの広告のコンポーネントを使用してSearchBannerView
負荷何かを作るために成功していますか?
これはiOSアプリ用で、このコンポーネントを使用しています:https://components.xamarin.com/view/googleiosmobileads