2014-08-31 56 views
0

我想補充leadbolt廣告控件,就像這裏 leadbolt integration guideC#/ XAML WP8.1添加Leadbolt廣告控制

首先,我下載Leadbolt SDK用於Windows Phone的8.1。 然後我創建了新的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 { 公共密封部分類的MainPage:頁 { 私人AdController myController的; (); public MainPage() { this.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?

回答

0

我想這是因爲您在Windows Phone 8.1 SDK上使用的Windows 8 SDK導致不兼容問題