首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法查看Firebase分析调试视图本机反应

无法查看Firebase分析调试视图本机反应
EN

Stack Overflow用户
提问于 2020-05-15 16:37:00
回答 2查看 7.9K关注 0票数 8

我已经学习了多个教程并阅读了多个Stackoverflow文章,但是无论我做什么,我都无法在使用DebugView的iOS应用程序中看到任何东西。我真的很想在这方面提供一些帮助。我花了好几天时间想办法解决这个问题,但我不知道是怎么回事。我在模拟器和物理设备上都试过了,但两者都没有成功。

我将在XCode的控制台中显示日志消息,但在Firebase控制台中没有显示任何内容。下面是我在本地使用事件时得到的消息:

React Native

代码语言:javascript
运行
复制
<TouchableOpacity
  onPress={() =>
    analytics().logSelectContent({
      content_type: "clothing",
      item_id: "abcd",
    })
  }
>
  <Text>Log message</Text>
</TouchableOpacity>;

日志

代码语言:javascript
运行
复制
2020-05-15 12:22:26.486761-0400 Example App[23464:8820959] 6.13.0 - [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: app, select_content, {
    content_type = clothing;
    ga_event_origin (_o) = app;
    ga_screen_class (_sc) = UIViewController;
    ga_screen_id (_si) = -3307323385789565728;
    item_id = abcd;
}
2020-05-15 12:22:26.487676-0400 Example App[23464:8820959] 6.13.0 - [Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: select_content, {
    content_type = clothing;
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = app;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = UIViewController;
    ga_screen_id (_si) = -3307323385789565728;
    item_id = abcd;
}
2020-05-15 12:22:26.500453-0400 Example App[23464:8820959] 6.13.0 - [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: select_content, {
    content_type = clothing;
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = app;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = UIViewController;
    ga_screen_id (_si) = -3307323385789565728;
    item_id = abcd;
}
2020-05-15 12:22:26.502567-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 0.9828788042068481
2020-05-15 12:22:26.502616-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 0.9828788042068481
2020-05-15 12:22:27.497172-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS002001] Measurement timer fired
2020-05-15 12:22:27.497304-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2020-05-15 12:22:27.497444-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS023033] Starting data upload
2020-05-15 12:22:27.501020-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS023105] Event is not subject to real-time event count daily limit. Marking an event as real-time. Event name, parameters: select_content, {
    content_type = clothing;
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = app;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = UIViewController;
    ga_screen_id (_si) = -3307323385789565728;
    item_id = abcd;
}
2020-05-15 12:22:27.511485-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS012018] Saving bundle. size (bytes): 499
2020-05-15 12:22:27.512391-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS023116] Bundle added to the upload queue. BundleID, timestamp (ms): 38, 1589559746485
2020-05-15 12:22:27.518879-0400 Example App[23464:8821128] 6.13.0 - [Firebase/Analytics][I-ACS023038] Uploading events. Elapsed time since last successful upload (s): 44.21102094650269
2020-05-15 12:22:27.519180-0400 Example App[23464:8820960] 6.13.0 - [Firebase/Analytics][I-ACS023039] Measurement data sent to network. Timestamp (ms), data: 1589559747518, <APMPBMeasurementBatch: 0x2808513f0>
2020-05-15 12:22:27.524885-0400 Example App[23464:8820960] 6.13.0 - [Firebase/Analytics][I-ACS900000] Uploading data. Host: https://app-measurement.com/a
2020-05-15 12:22:27.607462-0400 Example App[23464:8820960] 6.13.0 - [Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/a
2020-05-15 12:22:27.674761-0400 Example App[23464:8821408] 6.13.0 - [Firebase/Analytics][I-ACS023044] Successful upload. Got network response. Code, size: 204, -1
2020-05-15 12:22:27.679982-0400 Example App[23464:8821408] 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): -0.1942161321640015
2020-05-15 12:22:27.680071-0400 Example App[23464:8821408] 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): -0.1942161321640015
2020-05-15 12:22:27.688291-0400 Example App[23464:8821408] 6.13.0 - [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2020-05-15 12:22:27.688364-0400 Example App[23464:8821408] 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled

以下是我所做的一切:

我修改了我的AppDelegate.m

代码语言:javascript
运行
复制
// imports
#import <Firebase.h> // Imported Firebase.h
// more imports

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if ([FIRApp defaultApp] == nil) {
        [FIRApp configure];
    }
// ... rest of my didFinishLaunchingWithOptions

我将GoogleService-Info.plist添加到我的应用目标中。然后我跟踪了this post并:

现在并不重要,但对于那些在这个问题上遇到错误的人来说,这并不重要。由于GoogleServices-Info.plist文件中的问题,firebase分析的调试模式有时无法工作,只需进行这2项更改。

将IS_ANALYTICS_ENABLED设置为YES

将FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE设置为NO

完全删除FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED

然后,我将FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED从.plist中删除,就像this post建议的那样。还是不起作用。

确保没有启用OS_ACTIVITY_MODE:disable,就像this post说的

如果您在某个时候添加了环境变量,

一定要从项目方案中的环境变量中删除它。

设置环境变量

Podfile.lock相关部分

代码语言:javascript
运行
复制
- Firebase/Analytics (6.13.0):
    - Firebase/Core
  - Firebase/Core (6.13.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 6.1.6)
  - Firebase/CoreOnly (6.13.0):
    - FirebaseCore (= 6.4.0)
  - FirebaseAnalytics (6.1.6):
    - FirebaseCore (~> 6.4)
    - FirebaseInstanceID (~> 4.2)
    - GoogleAppMeasurement (= 6.1.6)
    - GoogleUtilities/AppDelegateSwizzler (~> 6.0)
    - GoogleUtilities/MethodSwizzler (~> 6.0)
    - GoogleUtilities/Network (~> 6.0)
    - "GoogleUtilities/NSData+zlib (~> 6.0)"
    - nanopb (= 0.3.9011)
  - FirebaseCore (6.4.0):
    - FirebaseCoreDiagnostics (~> 1.0)
    - FirebaseCoreDiagnosticsInterop (~> 1.0)
    - GoogleUtilities/Environment (~> 6.2)
    - GoogleUtilities/Logger (~> 6.2)
  - FirebaseCoreDiagnostics (1.2.4):
    - FirebaseCoreDiagnosticsInterop (~> 1.2)
    - GoogleDataTransportCCTSupport (~> 3.0)
    - GoogleUtilities/Environment (~> 6.5)
    - GoogleUtilities/Logger (~> 6.5)
    - nanopb (~> 0.3.901)
  - FirebaseCoreDiagnosticsInterop (1.2.0)
  - FirebaseInstanceID (4.2.7):
    - FirebaseCore (~> 6.0)
    - GoogleUtilities/Environment (~> 6.0)
    - GoogleUtilities/UserDefaults (~> 6.0)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-11-13 07:12:10

我也遇到了同样的问题,并设法通过

与-FIRDebugEnabled.一样,

  1. 设置环境变量

  1. 不是在react本地运行应用程序(例如:纱运行ios/
  2. ),而是直接在Xcode中运行。(如果您运行react本机,它也不会出现在调试视图中)。

然后,

  1. 神奇地将该设备显示在调试视图中。我没有遵循你提到的任何其他步骤。

这是我的版本以防万一。如果这个问题还没有解决,希望它能帮上一点忙。

代码语言:javascript
运行
复制
"react-native": "^0.63.2",
"@react-native-firebase/app": "^8.4.7",
"@react-native-firebase/analytics": "^7.6.9",
票数 14
EN

Stack Overflow用户

发布于 2021-01-19 19:49:26

所以,经过几个小时的阅读和测试,我想我会把这张便条留给任何想知道他们的设置是否有效的人。

另一个答案是:使用Xcode运行应用程序,使用调试标志,而不是通过终端运行,但也可以通过监视调试输出控制台中与firebase相关的消息.

我的似乎真的在工作,而你的也可能也是。我还发现,它们对事件进行了“批处理”,在您将应用程序放到后台之后,花了大约一个小时的时间才能将事件传递到firebase控制台调试视图。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61824212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档