C#/XAML WP8.1添加Leadbolt广告控件



我想添加引线螺栓广告控件,就像这里一样引线螺栓集成导轨

首先,我下载了适用于Windows Phone 8.1的Leadbolt SDK。然后我创建了新的Windows Phone应用程序。MainPage.xaml中有一个代码:

<Page
x:Class="App6.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App6"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Name="adWrapperGrid" >
    <!-- wrap your content with grid -->
    <Grid Name="yourContentGrid" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    </Grid>
</Grid>

和MainPage.xaml.cs

using LeadBolt.Windows8.AppAd;

命名空间App6{public sealed分部类MainPage:Page{private AdController myController;公共主页(){这InitializeComponent();

        this.NavigationCacheMode = NavigationCacheMode.Required;
    }
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        adWrapperGrid.Loaded += adWrapperGrid_Loaded;
    }
    void adWrapperGrid_Loaded(object sender, RoutedEventArgs e)
    {
        myController = new AdController(adWrapperGrid, "YOUR_LB_SECTION_ID");
        myController.LoadAd();
    }
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    {
        myController.DestroyAd();
        adWrapperGrid.Loaded -= adWrapperGrid_Loaded;
        base.OnNavigatedFrom(e);
    }
}

}

所以,我做的每件事都和链接中一样,但当我启动该应用程序时,它会显示我一个空白屏幕,没有广告。

有人能帮忙吗?或者推荐其他适用于Windows Phone 8.1应用程序的广告提供商,它现在是一个填充率接近0%的pubCenter?

我想这是因为你在Windows Phone 8.1 SDK上使用Windows 8 SDK,这会导致不兼容问题

最新更新