firebase 推送_使用Firebase的设备到设备推送通知

firebase 推送

In this article, we will outline the different elements you need to be aware of to send a push notification from one device to another using Firebase. The architecture and mechanism described are common between iOS and Android. Our intention in this article is to give the reader an understanding of the architecture and how everything needs to come together to allow one device to send a push notification to another. While we keep this article at a high level, we refer the reader to other online resources to learn more about the details of each operation and be able to implement this feature.

在本文中,我们将概述使用Firebase从一台设备向另一台设备发送推送通知时需要注意的不同元素。 所描述的架构和机制在iOS和Android之间很常见。 本文的目的是使读者了解该体系结构以及如何将所有内容整合在一起以允许一个设备向另一个设备发送推送通知。 在使本文保持较高水平的同时,我们还请读者参考其他在线资源,以了解有关每个操作的详细信息并能够实现此功能。

概述 (A high level overview)

Let’s look at the problem at a high level to identify different elements that are in play. Later in this article, we will delve into each element in more detail.

让我们从较高的角度看问题,以识别正在发挥作用的不同元素。 在本文的后面,我们将更详细地研究每个元素。

At a high level, the user of the sending device will take some action that will result in a change in the Firebase database. In return, Firebase will pick up this change and send a notification to another device, informing the receiving device about the change.

在较高级别上,发送设备的用户将采取某些措施,从而导致Firebase数据库发生更改。 作为回报,Firebase将获取此更改并将通知发送到另一台设备,以通知接收设备有关此更改的信息。

There are four main actions taken here:

这里有四个主要动作:

  1. Updating of the database by the sending device

    发送设备更新数据库
  2. Firebase listening for the change

    Firebase聆听变化
  3. Firebase sending a notification to the receiving device(s) in reaction to the change

    Firebase根据更改将通知发送到接收设备
  4. Receiving device(s) presenting the notification to the user

    向用户呈现通知的接收设备

In the rest of this article, we will go over each item above in more detail.

在本文的其余部分,我们将更详细地介绍上述每个项目。

发送设备更新数据库 (Updating of the database by the sending device)

Updating Firebase database is well documented. If you are reading this article, you most likely understand how to setup your app to communicate with Firebase and write to the database. We will not go into any details here. You can find more about how to setup your device and communicate with the database here for iOS and here for Android.

更新Firebase数据库已有详细记录。 如果您正在阅读本文,则很可能会了解如何设置您的应用程序以与Firebase通信并写入数据库。 在此我们将不赘述。 你可以找到更多关于如何设置你的设备,并与数据库通信这里 iOS和

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值