1

因此,在尝试在 Xcode 中为我的非弧形 iOS 应用程序加载图表提升一周后,我将开始问一些非常愚蠢的问题。我的 appdelegate 中的代码是:

(void)applicationDidBecomeActive:(UIApplication *)application {
    [[CCDirector sharedDirector] resume];
    Chartboost *cb = [Chartboost sharedChartboost];

    cb.appId = @"530dd707f8975c182ae2c691";
    cb.appSignature = @"0d8726e69c911a182b0cefac4eca36f692355725";

    // Required for use of delegate methods. See "Advanced Topics" section below.
    cb.delegate = self;

    // Begin a user session. Must not be dependent on user actions or any prior network requests.
    // Must be called every time your app becomes active.
    [cb startSession];
    [cb showMoreApps];
    [cb cacheInterstitial:@"Play Again"];
    [cb showInterstitial:@"Play Again"];
    // Show an interstitial
    [cb cacheInterstitial:@"Highscores"];
    [cb showInterstitial:@"Highscores"];

当我启动应用程序时,是的,我看到了测试广告,这一切都很好,但我无法让它在整个游戏中显示应用程序或让这些插页式广告完全正常工作。

所以我的第一个问题:随机广告是否会出现在整个应用程序中(但仅当游戏上传到应用程序商店而不是通过测试模式时)

其次,有人可以解释一下这个 showInterstitial 位置。我已经阅读了许多文档,甚至查看了有关图表提升的示例,它们仅链接到按钮而不是链接到,例如,当我在游戏中死去然后我想要出现广告时。所以有人可以在这里解释如何实现这些插页式外观,因为我的“再玩一次”和“高分”似乎什么也没做(是的,我添加了一个战役逻辑,但是当玩家死亡并且屏幕进入高分页面

4

1 回答 1

1

few things:

  1. Ads will appear throughout the app, not at random but where you place them.

  2. The locations are simply names for your own reference. You still need to place the showInterstitial code in the right place for it to show when you want in. For instance, when your player dies and you should call [cb showInterstitial:@"play again"]; and when the player navigates to the high score page you call [cb showInterstitial:@"highscores"];.

The location names can be anything: location1, location2 or play again, highscores... it doesn't actually matter. But you should call [cb showInterstitial:@"play again"]; only on play again, and [cb showInterstitial:@"highscores"]; only when players view the high score screen. Once you set all that up in the app, you can turn interstitials on/off via the dashboard.

Finally, you should never call cacheInterstitial and showInterstitial immediately after each other. This can cause a race condition and produce unexpected results. Simply call cacheInterstitial when you bootup, and showInterstitial everywhere else in your app.

If you have any other questions, feel free to email support@chartboost.com
Full disclosure: I work at Chartboost

于 2014-03-03T20:09:15.347 回答