2016-04-11 5 views
1

私のアプリにGoogle Adsを統合したいのですが、リクエストを読み込んで広告を取得する時が来ました。Xamarin.iOS Google Ads Targeting

私が必要とするのは、ターゲットパラメータを渡して、ユーザーの検索に関連する広告を読み込むことです。

を表示するためにSearchRequestをロードしようとしていますが、私のニーズに合った方法はありません。 SearchBannerViewLoadRequestのメソッドは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

答えて

0

この質問は回答しましたhereです。

バインディングライブラリで問題が発生しました。種類がSearchRequestで、タイプが間違っています(の代わりにGADRequest)。

関連する問題