【问题标题】:Google AdMob ads are not showingGoogle AdMob 广告未展示
【发布时间】:2018-07-05 15:38:24
【问题描述】:

我尝试为我的一个应用程序集成 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;

}

在视图控制器上

    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 链接后,我在 Ads 上方找到了 Admob 谷歌。但我还没有看到真正的广告。我很困惑我错过了什么让应用程序在 iPhone 设备上运行真实的广告。

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

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

我期待这里有一个真正的广告。

【问题讨论】:

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


    【解决方案1】:

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

    如果您删除设置测试设备的行并使用我从 Google 网站获得的测试广告单元 ID,它是否有效?

    ca-app-pub-3940256099942544/4411468910
    

    【讨论】:

      【解决方案2】:

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

      你在这个网站上注册了吗?

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

      【讨论】:

      • 是的,我在 google admob 上注册。这就是为什么我得到了应用 ID,以及添加到项目中的 adunitId 和 googleservice-info.plist 文件
      • 您是否尝试删除显示request.testDevices = @[ @"some value"]; 的代码行?
      • 是的,我确实删除了 request.testSevices
      • 好的,那么我唯一能想到的就是您需要更多的广告请求才能启动广告单元。我与许多广告网络 SDK 合作过,有些需要时间让广告单元完全正常工作,或者他们需要足够多的请求才能使新广告单元“值得”支付费用。我什至有时会发送垃圾广告请求,但一段时间后它就起作用了。
      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-06
        • 2016-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多