You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:实现用户不在当前聊天时的新消息通知功能(教程尝试未果)

问题:实现聊天应用的条件推送通知功能

我需要给聊天应用开发一个功能:当有新消息发送时,仅在接收用户未处于当前聊天会话界面的情况下,触发应用推送通知。已经看了多个YouTube教程,都没能解决这个问题。

聊天数据结构(Firebase)

/users/
    - $userId/
        + deviceId
        + username
        + email
        + uid
        + joined
        - conversations/
            - $userId/
                + conversationId

/conversations/
    - $conversationId/
        - members/
            + userId1
            + userId2
        - messages/
            - $messageId/
                + messageId
                + content
                + timestamp
                + type

我的源代码托管在GitHub仓库中。


内容的提问来源于stack exchange,提问作者ARCOON

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 03:59:54