Google AdMob广告未展示

时间:2018-07-05 15:38:24

标签: ios objective-c admob interstitial google-admob

我尝试为我的一个应用程序集成GoogleAdMob-非页内广告。 在这里显示。

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展示广告而付费吗?

enter image description here

与firebase链接后,我获得了高于Ads的Admob谷歌。但我还没有看到真正的广告。我很想让应用程序在iPhone设备上投放真实广告,这让我感到困惑。

一旦AdMob展示的插页式测试广告提示以下消息。

 _userSettingsForUser mobile: {
    filterBlacklist =     (
    );
    filterWhitelist =     (
    );
    restrictWeb = 1;
    useContentFilter = 0;
    useContentFilterOverrides = 0;
    whitelistEnabled = 0;
}

我希望在这里有一个真正的广告。

3 个答案:

答案 0 :(得分:0)

Google建议使用测试设备或示例广告单元ID。

如果您删除了用于设置测试设备的行并使用了我从Google网站上获得的该测试广告单元ID,它可以工作吗?

ca-app-pub-3940256099942544/4411468910

答案 1 :(得分:0)

要从Google获得真实的广告,您必须在Google网站上注册并注册一个帐户。然后,您必须在信息中心中注册您的应用,并能够为插页式广告或横幅广告或任何您喜欢的内容创建展示位置。创建这些广告后,您将获得有关真实流量和真实收入的广告单元ID。从那时起,您可以在Google信息中心中观察每个展示位置的收入。

您是否已在此网站上注册?

https://www.google.com/admob/?utm_source=google%20developers&utm_medium=et&utm_campaign=googledevproductsadmob&utm_content=ads

答案 2 :(得分:0)

如果有人遇到此问题,请检查您的AdMob页面->应用程序-您的应用程序-appSettings中,您的应用程序已与应用商店链接。我忘了联系我,这对我来说是个问题。