我正在尝试将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