- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当FacebookAutoLogAppEventsEnabled
未设置为false
时,是否需要将FBSDKAppEvents.activateApp()
添加到applicationDidBecomeActive
?
根据FBSDKAppEvents.h
,这是没有必要的:
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. This function is called automatically from FBSDKApplicationDelegate applicationDidBecomeActive, unless one overrides 'FacebookAutoLogAppEventsEnabled' key to false in the project info plist file. In case 'FacebookAutoLogAppEventsEnabled' is set to false, then it should typically be placed in the app delegates'
applicationDidBecomeActive:
method.
FB docs 证实了这一点其中添加 activateApp
位于“手动事件日志记录”下:
The process described here for manual event logging with the SDK is provided so that you have the option of controlling when app events are logged. We recommend that you do not disable automatic logging because it may impact how data is collected for your app.
但是在 Swift Reference它说:
Logging app activations as an app event enables most other functionality and should be the first thing that you add to your app.
那么它应该添加还是为 Swift 应用程序自动调用?
最佳答案
FacebookAutoLogAppEventsEnabled
- 自动收集应用程序事件。
FBSDKAppEvents.activateApp()
- 手动发送应用程序事件。它保证无论外部因素如何,事件都会被强制收集,当然前提是SDK使用正确的AppId初始化。
基于FB docs discussion FBSDKAppEvents.activateApp()的:
activateApp
will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. "activated app" events will be logged when the app has not been active for more than 60 seconds.
这暗示他的内部逻辑很聪明,并不取决于他被调用的方式、地点和频率。
我的观点(如果这对您很重要)是收集应用程序事件进行分析。我建议手动调用 applicationDidBecomeActive
中的 FBSDKAppEvents.activateApp()
方法,并行且独立于自动 FacebookAutoLogAppEventsEnabled
。这不会是警告、错误或违反指南的行为。
如果我给出的论据太少来证实我的建议。然后,如果有必要,我会以扩展的形式描述我的指导思想以及我如何分析以采纳这样的观点。
关于ios - 将 Facebook SDK `activateApp` 添加到 `applicationDidBecomeActive` 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51006053/
我们遇到了一次奇怪的崩溃 - 现在我知道是什么原因造成的,但我注意到的一件奇怪的事情是所有崩溃日志在两个单独的背景上都有 -applicationDidBecomeActive线程 Thread 5:
我如何确定当前在 applicationDidBecomeActive 中的 Controller /窗口?例如在登录屏幕(这是一个 LoginViewController)上,如果 applicat
使用 Storyboard和 UINavigationController 我的应用程序有很多 UIViewControllers。最初的 UIViewController 被命名为 viewCont
我正在使用 NSLog 语句来了解何时调用 -applicationDidBecomeActive:,但它似乎从未被调用过。这是代码: - (void)applicationDidBecomeActi
applicationDidBecomeActive 方法何时被调用?这个方法的目的是什么? 最佳答案 了解 iOS 的状态和转换 州 未运行 - 应用未运行。 Inactive - 应用程序在前台运
我的应用程序委托(delegate)方法 applicationDidBecomeActive: 在应用程序首次启动时被调用两次。我有一些代码我只想执行一次并且我已经放入 applicationDid
在带有 RevenueCat 的 tvOS 13.4 上,当我在 4K 电视设备上运行我的应用程序,然后关闭电视(让应用程序保持运行)时,我得到以下信息: 2020-05-10 12:21:59-07
当我的手机长时间闲置并收到来自应用程序的推送时,我希望能够打开应用程序并执行网络功能。这通常有效。我在主应用程序 View 中发布来自 applicationDidBecomeActive 的通知,因
要求 - 当用户从后台 tabBar 打开应用程序时,所选索引应为 2 我尝试过的 - //For getting current visible controller - public ex
我有一个使用地理围栏的应用程序。当您越过地理围栏时,该应用程序会启动 - 但它是否会进入“事件”状态,即使它是从后台启动的?我们在 applicationDidBecomeActive 中有相关代码。
我有一种方法可以在应用程序激活时检查剪贴板: - (void)applicationDidBecomeActive:(UIApplication *)application { [[NSNot
这是我的应用委托(delegate)中 applicationDidBecomeActive 的主体 if (myViewController != nil) { [myViewControl
我正在使用 UILocalNotification 对象开发闹钟应用程序。在我的代码中,当报警并且用户点击通知面板时,我的应用程序将显示另一个 View Controller 。为了满足这种情况,我在
我正在使用重复本地通知向用户显示警报。为此,我使用了下面的代码 UILocalNotification* localNotification = [[UILocalNotification alloc
这是我的第一个问题,因为我在开发我的第一个 iOS 应用程序时遇到了问题。它是数以千计的手电筒应用程序之一,但我正在尝试为其添加尽可能多的功能。其中之一是在应用程序进入后台或终止时保存应用程序的状态。
当我的应用进入后台时,出于数据保护的原因,它必须模糊当前屏幕。屏幕内容不能在任务管理器窗口中看到,因此必须在应用程序退出之前完成模糊例程。随着每次 UI 更新,模糊处理必须在主循环中进行。它只是在普通
当用户通过将应用程序切换到前台来激活应用程序时,我需要在屏幕上隐藏一些东西。 我已经尝试在 applicationDidBecomeActive 或 applicationWillEnterForeg
我在尝试实现 iOS-8 的新交互式通知时遇到了这个奇怪的问题。在处理本地通知时,一切都按预期工作,但在处理 APNS 时,一切都不太顺利。 详细信息:我通过横幅获得自定义推送(我只注册到最小上下文)
applicationDidBecomeActive 方法在应用程序激活时被调用,有没有办法可以为某个 UIViewController 执行此方法?我知道有用于 View Controller 的
当应用在后台收到远程推送通知时,应用进入applicationDidBecomeActive。从那里,如何从通知中访问数据的 NSDictionary? 最佳答案 通知数据在 application:
我是一名优秀的程序员,十分优秀!