iphone - 如何知道 iOS 中是否没有 admob?

标签 iphone ios admob

我正在使用 admobs,我想知道 admobs 是否不会出现。 如果 Admobs 没有来,那么我应该隐藏该 View ,当他们再次开始出现时,我必须在屏幕上向他们显示。 如果我的问题很愚蠢,请不要介意。 有什么帮助吗?

最佳答案

您应该使用委托(delegate)函数来了解是否收到广告,然后进行相应的处理。

使用 GADBannerViewDelegate

像这样实现委托(delegate)函数:

// We've received an ad successfully.

- (void)adViewDidReceiveAd:(GADBannerView *)adView {
    NSLog(@"Received ad successfully");
}

// Ad Not Recieved

- (void)adView:(GADBannerView *)view
didFailToReceiveAdWithError:(GADRequestError *)error {
    NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
}

- (void)adViewWillPresentScreen:(GADBannerView *)bannerView
{
    NSLog(@"will Present");
}

关于iphone - 如何知道 iOS 中是否没有 admob?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12853393/

相关文章:

iphone - 如何以编程方式获取iphone的IP地址

iphone - 如何像 facebook iphone 应用程序一样全屏打开图像?

android - 解决 AdMob 的 35 个字符 URL 限制?

iphone - CSS3 : Detecting device orientation for iPhone

iphone - 如何创建包装器以将 block 用于使用回调的类?

ios - Tableview 单元格每次加载时都会重新加载多个表格单元格

ios - 为 Google Maps iOS 应用缩放级别条件

ios - 使用 AFNetworking 2.0 加载图像

android - AdMob测试仪有什么意义?

android - "No ad config"错误 onAdFailedToLoad 即使使用测试广告单元