【问题标题】:analytics().logEvent() return null and not tracking the event in consoleanalytics().logEvent() 返回 null 并且不在控制台中跟踪事件
【发布时间】:2020-12-29 10:58:24
【问题描述】:

我想在 React Native 中使用 Firebase 分析。我已经添加了库, 但是当我使用await analytics().logEvent("event_name") 它返回null 并且事件也没有添加到firebase 分析控制台中。

有人知道怎么回事吗?

<Button
     title="Add To Basket"
     onPress={async () =>
       await analytics().logEvent('basket', {
         id: 3745092,
         item: 'mens grey t-shirt',
         description: ['round neck', 'long sleeved'],
         size: 'L',
       })
     }
   />

【问题讨论】:

    标签: reactjs react-native firebase-analytics


    【解决方案1】:

    当我开始使用分析时,我遇到了同样的问题。

    Firebase 表示这些事件大约需要 24 小时才能在控制台上显示。

    此外,logEvent 的返回类型为 void,因此您会看到 null 被返回。所以除非你有错误,否则不要担心这方面。

    所以,我建议您等待更改反映。


    出于开发目的,我们需要查看实时事件,而 Firebase 提供了 DebugView。有关详细信息,请参阅此文档: https://firebase.google.com/docs/analytics/debugview

    【讨论】:

    • 谢谢您的帮助,先生。明白了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-24
    • 1970-01-01
    相关资源
    最近更新 更多