ios - inAppPurchase 后停止 Flurry Ads,不退出应用程序

标签 ios iphone objective-c ads flurry

我开始使用 appDeleget.m appDeleget.m 中的以下两个语句来使用 flurry ads

if(![[NSUserDefaults standardUserDefaults] boolForKey:@"Purchased"]) {
    [Flurry startSession:FLURRY_ID];//FLURRY_ID is the #define @"flurry_adID"
    [FlurryAds initialize:self.window.rootViewController];        
}

util 直到用户在购买后至少没有退出应用程序一次,flurryAds 不会停止,flurryAds 不会停止。

我想在用户购买应用程序后立即停止 flurry 广告。

最佳答案

不要使用 appDelegate。检查 ViewController 中的 if 语句。不适合你的原因是因为你在 AppDelegate 中调用它。你在哪里调用这段代码? DidFinishLaunching 方法?

我会做的是:购买时:创建 BOOL 键并在购买完成时调用它。然后你仍然可以使用 appDelegate 来检查 NSUserDefaults。

[Flurry startSession:FLURRY_ID];//FLURRY_ID is the #define @"flurry_adID"
[FlurryAds initialize:self.window.rootViewController];

关于ios - inAppPurchase 后停止 Flurry Ads,不退出应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21855152/

相关文章:

ios - 带有 iOS8 的 iPod Touch 被检测为 iPhone

iPhone,如何获取设备短日期格式?

iphone - 保存 250 MB 数据后 iPad 应用程序崩溃

iphone - 将 ViewController 数据加载到模型中

ios - 在 NSAttributedString 文本下绘制稀松布 ("Blurry Transparent Rectangle")

ios - scrollRectToVisible:CGRectMake无法正常工作

ios - 核心数据 : should I be fetching objects from the parent context or does the child context have the same objects as the parent?

objective-c - 怎么会connectionDidFinishLoading : run if no file is found on server?

objective-c - NSTextField doubleValue 本地化混淆

objective-c - 使 UISearchBar 在 View 加载时成为第一响应者