【问题标题】:maintain connection status of user with firestore. using firebase db and cloud function维护用户与firestore的连接状态。使用 firebase db 和云功能
【发布时间】:2018-04-12 09:57:34
【问题描述】:

我正在尝试保持用户与 firestore 的连接状态。但有些地方我不明白。

链接:https://firebase.google.com/docs/firestore/solutions/presence

我参考了上面的链接描述,但我不明白如何编写代码。 请参阅以下给定主题:

  1. 在实时数据库中使用状态

    在应用程序或云函数中何处编写此给定代码?

2.连接到 Cloud Firestore

  1. 更新 Cloud Firestore 的本地缓存

    在哪里写本地缓存更新代码?

我在我的 android 应用程序中使用它。

【问题讨论】:

    标签: firebase firebase-realtime-database google-cloud-firestore google-cloud-functions


    【解决方案1】:

    Build Presence in Cloud Firestore 中代码的每个部分都有标记。

    如果它被标记为 WEB,则需要在 Web 应用程序中运行此代码。如果您的客户端是原生 Android 或 iOS,您将需要为这些平台编写和运行类似的代码。

    如果代码标有 NODE.JS,则需要在 Node.js 环境中运行此代码。在 Cloud Functions 中应该可以实现相同的功能,但没有提供示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-09
      • 2018-11-22
      • 2018-06-30
      • 1970-01-01
      • 2018-11-21
      • 1970-01-01
      • 2021-07-16
      • 2023-03-27
      相关资源
      最近更新 更多