【问题标题】:Why is Firebase Analytics disabled for my iOS app?为什么我的 iOS 应用禁用了 Firebase Analytics?
【发布时间】:2018-04-19 17:42:43
【问题描述】:

我编写了一个使用 Firebase 的应用。我相信我已经正确安装了它,并且我已经在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 中完成了[FIRApp configure];

我还为项目方案添加了调试参数,以查看发生了什么。 Firebase 似乎按预期工作,只是它一直告诉我 Firebase 分析已禁用。

我在 Xcode 中的登录:

Firebase screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
Configuring the default app.
InstanceID library version 2.0.5
Debug mode is on
Firebase Analytics v.40004000 started
Firebase Analytics disabled
Tracking view controller. Class, ID: MainViewController
Screen view event not logged. App is not active.
Firebase Analytics is disabled. Event not logged

所以 Firebase 显然可以工作,但它不会让我发送任何自定义或其他事件。我找不到其他有这个问题的人。我相信我的项目在 console.firebase.com 中设置正确,但它根本不会在那里发送任何数据。我已经下载并添加了我的GoogleServices-Info.plist 文件。我的应用面向 iOS9 及更高版本,我使用的是 Objective-C。

我已遵循本指南:https://firebase.google.com/docs/ios/setup#add_firebase_to_your_app

编辑

在 Firebase 存在之前,我的项目很旧。所以我从谷歌云平台导入了它。我想这可能是问题所在。我尝试在另一个帐户上创建一个全新的项目,然后添加了一个全新的应用程序。 Firebase 按预期工作。有人在从 Google Cloud Platform 迁移时遇到过任何问题吗?

【问题讨论】:

    标签: ios objective-c firebase google-cloud-platform firebase-analytics


    【解决方案1】:

    TL;DR 尝试将 Firebase SDK 更新到最新版本。

    万一有人看到这个帖子。我们遇到过类似@ClockWise 遇到的情况。但是,在尝试使用 info.plist 进行调整之后。原来原因是SDK的版本。

    我们曾经拥有版本 6.11.0(firebase) 和 6.1.3(firebase analytics),在运行 pod update 将 sdk 更新到最新版本 (6.21.0) 后,它可以正常工作,调试视图正在工作,我们可以在 firebase 仪表板中看到事件。

    【讨论】:

      【解决方案2】:

      所以我终于找到了问题所在。完全创建一个新项目并将我的应用程序移至该项目后,它仍然无法正常工作。因此,我开始扫描整个项目,寻找可能导致 Firebase 禁用日志记录的任何内容。

      原来FIREBASE_ANALYTICS_COLLECTION_DEACTIVATEDInfo.plist 文件中设置为YES。我不知道为什么,因为该项目在我开始添加之前根本没有使用 Firebase。希望这个错误可以帮助遇到同样问题的其他人。

      【讨论】:

      • 谢谢,你帮我节省了时间。
      • 确保在 plist 表视图中将 YES 设置为 Boolean 而不是 String,或者在源代码中设置为 /key = /true。
      猜你喜欢
      • 2020-01-05
      • 2020-02-24
      • 2021-02-27
      • 2011-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-04
      • 1970-01-01
      相关资源
      最近更新 更多