无法在windows phone 8中使用AdMob中的AdView关键字
本文关键字:AdMob 中的 AdView 关键字 windows phone | 更新日期: 2023-09-27 18:11:23
我在我的一个应用程序中使用了windows phone 8的AdMob。
xaml如下:
<GoogleAds:AdView Name="AdView" Height="80" Width="480" Grid.Row="2" Margin="0,5,0,0"
AdUnitID="MyAdunitId" Format="Banner"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalContentAlignment="Bottom" HorizontalContentAlignment="Center"
/>
这个加载广告。现在,我试图根据Keywords
属性获取广告。代码看起来像这样:
AdRequest rq = new AdRequest();
rq.Keywords = keywordsForAds.ToArray();
AdView.LoadAd(rq);
但是,无论如何,显示的广告都不是基于我指定的关键字。同样,在ReceivedAd
事件中,我注意到AdView.Parameter.Keywords
是一个空字符串数组。
我错过了一些东西在这里使用Keywords
?
试试这个:
AdRequest rq = new AdRequest();
string[] Keywords = { "Keyword1", "Keyword2", "Keyword3", "Keyword4" };
rq.Keywords = Keywords;
AdView.LoadAd(rq);