我正在使用我正在开发的应用中的RevMob广告,我想知道的是我如何在每5个应用开放时展示一个全屏广告。我无法弄清楚如何做到这一点,我在网上找不到任何关于此的内容。谢谢你的帮助!
我正在使用的当前代码在AppDelegate.m中:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[RevMobAds session].parallaxMode = RevMobParallaxModeOff;
[[RevMobAds session] showFullscreen];
}
答案 0 :(得分:2)
使用NSUserDefaults存储应用程序打开的次数,并在每次- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
然后做任何你想做的事情,无论何时打开5次:]
例如:
NSInteger timesLaunched = [[NSUserDefaults standardUserDefaults] integerForKey:@"timeslaunched"]
timesLaunched++
[[NSUserDefaults standardUserDefaults] setInteger:timesLaunched forKey:@"timeslaunched];
if (timesLaunched % 5 == 0) {
// Show Ads
}