有趣的是,广告肯定是在加载。
我的应用程序是基于故事板的,我使用横向模式(屏幕翻转显示另一个视图控制器)。
当用户将按钮按到另一个屏幕上时,当视图被翻转时,您可以看到加载的kiip广告(通常情况下,屏幕翻转时背景是黑色的,但是当第二个kiip广告被调用时,则会有一个kiip广告)。
第二个广告装在哪里?
我如何使广告加载,以便用户可以看到第二个广告,第三个广告,等等?
编辑:在深入研究之后,如果i没有模态和模态返回到原始的视图控制器,则Kiip广告加载了多次非常好的。
例如,如果我显示一个kiip广告,模态到一个不同的屏幕,然后模态返回,并尝试显示另一个kiip广告,广告确实显示(但仍然加载)。
// Show Kiip Reward and reset task
-(IBAction)resetTasks:(id)sender{
[[Kiip sharedInstance] saveMoment:@"my_moment_id" withCompletionHandler:^(KPPoptart *poptart, NSError *error) {
if (error) {
NSLog(@"something's wrong");
// handle with an Alert dialog.
}
if (poptart) {
[poptart show];
}
if (!poptart) {
// handle logic when there is no reward to give.
}
}];
//hide the button that allows shows user kiip ad for their accomplishment
resetButton.hidden = YES;
//reset other game logic after 4 seconds so there is time for the ad to load
[self performSelector:@selector(resetGame) withObject:nil afterDelay:4];
}
- (void) kiip:(Kiip *)kiip didReceiveContent:(NSString *)contentId quantity:(int)quantity transactionId:(NSString *)transactionId signature:(NSString *)signature {
// Give the currency to the user by using your in-app currency management.
totalCoins = totalCoins + quantity;
[[NSUserDefaults standardUserDefaults] setInteger:totalCoins forKey:@"totalCoins"];
}发布于 2016-10-03 19:04:26
所以我找到了一种方法来解决这个问题,如果你在你的故事板上经常使用modals,而kiip广告不会加载。
我将这段代码添加到viewDidLoad中,而kiip广告现在显示了不止一次。
-(void) viewDidLoad {
Kiip *kiip = [[Kiip alloc] initWithAppKey:@"YOUR KEY" andSecret:@"YOUR SECRET"];
kiip.delegate = self;
[Kiip setSharedInstance:kiip];
}https://stackoverflow.com/questions/39823024
复制相似问题