我正在开发一个uwp应用程序,我完成了它并准备通过开发中心在商店中提交我的应用程序。我的应用程序有AdControl
广告,通过VisualStateManager
我的AdControl
:(示例)
<UI:AdControl ApplicationId="d25517cb-12d4-4699-8bdc-52040c712cab"
AdUnitId="test"
HorizontalAlignment="Left"
Height="250"
VerticalAlignment="Top"
Width="300"/>
在我的桌面版中:
<Setter Target="Ad.Height" Value="90"/>
<Setter Target="Ad.Width" Value="728"/>
在移动版中我有:
<Setter Target="Ad.Height" Value="50"/>
<Setter Target="Ad.Width" Value="320"/>
也就是说,横幅的大小适应不同的屏幕尺寸。
我也有这个:
// Declare an AdControl.
private AdControl myAdControl = null;
// Application ID and ad unit ID values for Microsoft advertising. By default,
// assign these to non-mobile ad unit info.
private string myAppId = WAPPLICATIONID;
private string myAdUnitId = WADUNITID;
Add the following code to your Page class constructor, after the call to the InitializeComponent() method.
Copy
C#
myAdGrid.Width = AD_WIDTH;
myAdGrid.Height = AD_HEIGHT;
// For mobile device families, use the mobile ad unit info.
if ("Windows.Mobile" == AnalyticsInfo.VersionInfo.DeviceFamily)
{
myAppId = MAPPLICATIONID;
myAdUnitId = MADUNITID;
}
// Initialize the AdControl.
myAdControl = new AdControl();
myAdControl.ApplicationId = myAppId;
myAdControl.AdUnitId = myAdUnitId;
myAdControl.Width = AD_WIDTH;
myAdControl.Height = AD_HEIGHT;
myAdControl.IsAutoRefreshEnabled = true;
myAdGrid.Children.Add(myAdControl);
我的主页上只有一个广告,我在哪里放置PC /平板电脑ID和手机ID?
我必须创建两个AdControl
吗? (每个设备系列一个)