我正在嘗試將AdMob中的Windows Phone 8應用程序遊戲整合起來,但我有一些困難(我正在使用最新的廣告羣發widows sdk - 6.5.11)。加載插頁式廣告時出現
我可以加載並顯示AdMob橫幅沒有問題,但在嘗試加載插頁式廣告時會出錯。
基本上,當加載廣告,我得到以下異常:
型「System.SystemException」的異常出現在Microsoft.Phone.Interop.ni.dll,並沒有一個管理的前處理/本地邊界 型「System.SystemException」的異常出現在Microsoft.Phone.Interop.ni.dll並未能接收INT廣告,錯誤NOFILL
SO一個管理/本地邊界 之前沒有處理,當我嘗試顯示添加我顯然得到了進一步的例外:
Microsoft.Phone.Interop.ni.dll中發生類型'System.SystemException'的異常,並且未在託管/本機邊界之前處理 GoogleAds.InterstitialAd 'TaskHost.exe'(CLR C:\ windows \ system32 \ coreclr.dll:Silverlight AppDomain):加載'C:\ windows \ system32 \ en-US \ mscorlib.debug.resources.dll'。模塊沒有符號。 類型「System.NullReferenceException」的第一次機會異常發生在GoogleAds.DLL
這裏是我的加載代碼:
public static void LoadAdverts()
{
runInUIThread(
() =>
{
LoadGoogleInterstitialAd();
});
}
private static void LoadGoogleInterstitialAd()
{
// Initialize the ad
mGoogleInterstitialAd = new InterstitialAd(mGoogleInterstitialAdUnitID);
// Attach the interstitial event handlers.
mGoogleInterstitialAd.ReceivedAd += OnGoogleInterstitialAdReceived;
mGoogleInterstitialAd.FailedToReceiveAd += OnFailedToReceiveGoogleInterstitialAd;
mGoogleInterstitialAd.DismissingOverlay += OnDismissingGoogleOverlay;
AdRequest mGoogleInterstitialAdRequest = new AdRequest();
mGoogleInterstitialAdRequest.ForceTesting = true;
mGoogleInterstitialAd.LoadAd(mGoogleInterstitialAdRequest);
}
的LoadAd()方法是生成初始系統異常的人。
然後顯示廣告:
public static void DisplayOverlayAdvert()
{
// Check that the overlay ad is not already displayed.
if (!mIsGoogleInterstitialAdActive)
{
runInUIThread(
() =>
{
DisplayGoogleInterstitialAd();
});
}
}
/// <summary>
/// This method displays an advert in the advert container grid.
/// </summary>
private static void DisplayGoogleInterstitialAd()
{
mGoogleInterstitialAd.ShowAd();
// Set the flag to true as the ad is displayed.
mIsGoogleInterstitialAdActive = true;
}
任何幫助將不勝感激。
我可以肯定地確認在顯示之前調用加載 - 我甚至試圖將加載功能放入顯示方法 - 仍然會出現相同的錯誤。 admob windows phone sdk可能有問題嗎? –
對不起,不知道。在過去的七年中,沒有爲Windows手機編碼。 – William