我正在使用 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/