gpt4 book ai didi

ios - 将插页式广告添加到 chartboost

转载 作者:行者123 更新时间:2023-11-29 12:52:21 26 4
gpt4 key购买 nike

因此,在尝试在 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"];

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

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

其次,有人可以解释一下这个节目的间隙位置吗?我已经阅读了很多文档,甚至浏览了图表提升的示例,它们只链接到按钮而不是,例如,当我在游戏中死了然后我想要一个广告出现时。所以有人可以在这里解释如何实现这些间隙外观,因为我的“再次玩”和“高分”似乎什么都不做(是的,我已经添加了一个事件逻辑,但是当玩家死亡时仍然没有广告显示屏幕进入高分页面

最佳答案

一些事情:

  1. 广告将出现在整个应用程序中,不是随机出现,而是出现在您放置它们的位置。

  2. 这些位置只是供您自己引用的名称。您仍然需要将 showInterstitial 代码放在正确的位置,以便它在您需要时显示。例如,当您的玩家死亡时,您应该调用 [cb showInterstitial:@"play again "]; 当玩家导航到高分页面时,您调用 [cb showInterstitial:@"highscores"];

位置名称可以是任何内容:location1location2play againhighscores...其实并不重要。但是你应该调用[cb showInterstitial:@"play again"];再次播放,并且[cb showInterstitial:@"highscores"]; 当玩家查看高分屏幕时。在应用中完成所有设置后,您可以通过仪表板打开/关闭插页式广告。

最后,您不应该紧接着调用 cacheInterstitialshowInterstitial。这可能会导致竞争条件并产生意外结果。只需在启动时调用 cacheInterstitial,然后在应用的其他任何地方调用 showInterstitial

如果您有任何其他问题,请随时发送电子邮件至 support@chartboost.com
完全披露:我在 Chartboost 工作

关于ios - 将插页式广告添加到 chartboost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22115780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com