我正在尝试使用静态类加载 Admob 插页式广告,因此我可以在方便的时候显示它。
我创建了一种加载插页式广告的方法:
public static void GetInterstitial()
{
interstitial = new GADInterstitial ();
interstitial.AdUnitID = "my_ad_unit_id";
interstitial.LoadRequest (GADRequest.Request);
interstitial.DidReceiveAd += (sender, args) => {
didInterstitialLoad = true;
} ;
interstitial.DidFailToReceiveAd += (object sender, GADInterstitialDidFailToReceiveAdWithErrorEventArgs e) => {
didLoadInterFailed = true;
};
interstitial.DidDismissScreen += (sender, e) => {
//TODO - Handle interstitial dismiss ();
};
}
然后在我的 ViewController 中:
if (isInterstitialLoaded) {
interstitial.PresentFromRootViewController(this.NavigationController);
}
这是第一次工作,但之后我在 interstitial.DidFailToReceiveAd 中收到以下错误:
不会发送请求,因为已使用插页式对象
可以做些什么来修复它?