Crashlytics 是否错误统计了应用程序 Class 上的活跃用户数?

Does Crashlytics miscounts active users on Application Class?

如果调用 Crashlytics.start(this) 是在 ApplicationonCreate() 方法上,如果某些东西唤醒了我的应用程序进程,它会算作活跃用户吗?

例如如果我有广播接收器或闹钟,如果它们唤醒了应用程序,它会算作活跃用户吗?

谢谢

我想它应该,除非它有一些更复杂的逻辑 "actual activity" 而不是仅仅打开应用程序。 Application.onCreate() 在您的应用的任何 Activity、服务或广播开始时被调用。

这是 android 文档中的内容:

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created. Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process. If you override this method, be sure to call super.onCreate().

但请记住,如果应用程序已经 运行ning,Application.onCreate 将不会重新 运行,因为它已经创建。

我会说这不算数,但我的回答纯粹是基于逻辑和常识。

Crashlytics 推荐的方法是在您的 Application class 中初始化 SDK,以便在您应用的生命周期中尽快收集崩溃日志(以及所有其他类型的信息) .当他们引入 Answers 面板时,我的猜测是他们根据一系列指示用户实际操作应用程序的参数和操作(即,顺便说一句,每个 Analytics SDK 提供商都不同,例如 Google Analytics)。

简而言之,我认为 Crashlytics.start() 方法不会立即计入活跃用户,因为那只是胡说八道。但有一种快速确定的方法:

  1. 创建一个在您发送特定广播消息时启动的测试平台应用程序
  2. ApplicationonCreate()方法中初始化SDK
  3. 使用adb发送广播消息,同时关注CrashlyticsAnswers页面
  4. 稍等片刻(注册点击可能需要一些时间):用户是否被跟踪为活跃用户?

您可以尝试联系 Crashlytics 对此提供支持,但我不确定他们是否会泄露此信息。

编辑

添加一些我发现的证据 here:

A session begins when the app enters the foreground and ends once the app is backgrounded for 30 seconds or longer.

这让人相信(正如我上面所写的)他们检测活跃用户的方式并不完全依赖于 SDK 初始化。