Ios 谷歌AdMob广告没有显示
我试图为我的一个应用程序集成GoogleAdMob-Interstitual。 这是它的表演Ios 谷歌AdMob广告没有显示,ios,objective-c,admob,interstitial,google-admob,Ios,Objective C,Admob,Interstitial,Google Admob,我试图为我的一个应用程序集成GoogleAdMob-Interstitual。 这是它的表演 interstitial:didFailToReceiveAdWithError: Request Error: No ad to show. Ad wasn't ready 在AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launch
interstitial:didFailToReceiveAdWithError: Request Error: No ad to show.
Ad wasn't ready
在AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GADMobileAds configureWithApplicationID:@"AppID Value"];
return YES;
}
在ViewController上
static NSString *const GADAdUnitID = @"ADUnitId Value";
#pragma mark - googleAdsMobile
- (GADInterstitial *)createAndLoadInterstitial {
GADInterstitial *interstitial =
[[GADInterstitial alloc] initWithAdUnitID:GADAdUnitID];
interstitial.delegate = self;
GADRequest *request = [GADRequest request];
request.testDevices = @[ @"some value"];
[interstitial loadRequest:request];
return interstitial;
}
/// Tells the delegate an ad request succeeded.
- (void)interstitialDidReceiveAd:(GADInterstitial *)ad {
NSLog(@"interstitialDidReceiveAd");
}
/// Tells the delegate an ad request failed.
- (void)interstitial:(GADInterstitial *)ad
didFailToReceiveAdWithError:(GADRequestError *)error {
NSLog(@"interstitial:didFailToReceiveAdWithError: %@", [error localizedDescription]);
}
/// Tells the delegate that an interstitial will be presented.
- (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
NSLog(@"interstitialWillPresentScreen");
}
/// Tells the delegate the interstitial is to be animated off the screen.
- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
NSLog(@"interstitialWillDismissScreen");
}
/// Tells the delegate the interstitial had been animated off the screen.
- (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
NSLog(@"interstitialDidDismissScreen");
self.interstitial = [self createAndLoadInterstitial];
}
/// Tells the delegate that a user click will open another app
/// (such as the App Store), backgrounding the current app.
- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
NSLog(@"interstitialWillLeaveApplication");
}
应用程序上没有显示广告
我需要付费订阅googleAdMob来播放广告吗
在与firebase的Admob谷歌链接后,我得到了上面的广告。但我还没有看到真正的广告。我很困惑,我错过了什么才能让应用程序在iPhone设备上运行真正的广告
一旦来自AdMob的间隙测试ad显示,提示以下消息
_userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
我希望这里有一个真正的广告。谷歌建议要么使用测试设备,要么使用一个样本广告单元ID 如果你删除了设置测试设备的行,并使用我从谷歌网站上获得的这个测试广告单元ID,这是否有效
ca-app-pub-3940256099942544/4411468910
要从谷歌获得真正的广告,你必须在谷歌的网站上注册并注册一个账户。然后,你必须在仪表板中注册你的应用程序,并能够为间隙或横幅或任何你喜欢的内容创建放置位置。当你创建了这些,你会得到真实流量和真实收入的广告单位ID。从那时起,你可以在谷歌的仪表板上观察每个位置的收入 你在这个网站上注册了吗
如果有人遇到此问题,请检查AdMob页面->应用程序-你的应用程序-应用程序设置中,你的应用程序是否与应用商店链接。我忘了链接我的,这是我的问题。是的,我在谷歌admob上注册。这就是为什么我得到了app ID、adunitId和googleservice-info.plist文件,它们被添加到project Too中。你是否试图删除写着
request.testDevices=@[@“some value”]的代码行代码>?是的,我确实删除了请求。testSevicesOkay,那么我唯一能想到的是,您需要更多的广告请求来启动广告单元。我曾与许多广告网络SDK合作,其中一些需要时间来让广告单元工作,或者他们需要足够的请求来创建一个新的广告单元,使其具有足够的“价值”,足以支付费用。我甚至有时会发垃圾广告请求,过了一段时间它就起作用了。