Firebase Cloud Messaging是否需要服务器? [英] Is a server required for Firebase Cloud Messaging?
问题描述
我目前正在开发一个Android应用,我想包括Firebase Cloud Messaging. 我打算让Raspberry Pi每5分钟左右检查一次网站,并在发生更改时发送推送通知. 在官方文档中,他们说我需要一个应用服务器"才能通过Firebase发送消息.
I am currently developing an Android app and I would like to include Firebase Cloud Messaging. I was planning to have a Raspberry Pi checking a website every 5 Minutes or so and sending push notifications when something changed. In the official documentation they say that I need an 'app-server' in order to send messages via Firebase.
这是否意味着我需要启动Raspi并将其作为24/7服务器运行,并需要一个静态IP/域? 还是让我的Raspi通过Api发送消息就足够了( https://fcm.googleapis.com /fcm/send ),因为我只需要下游消息?
Does that mean I need to have my Raspi up and running as a server 24/7 and need a static IP / Domain for it? Or is it enough to have my Raspi send the message via the Api (https://fcm.googleapis.com/fcm/send) as I only need downstream messages?
任何帮助和解释将不胜感激,因为我在任何主题或文档中都找不到明确的答案.
Any help and explanation would be highly appreciated as I can't find a definite answer in any thread or documentation.
推荐答案
您不需要这样的应用程序服务器仅需要一台设备.如果您在Raspberry Pi设备上具有某种类型的Internet连接,则只需向Firebase API发出请求即可.
You don't as such need an app-server for just one device. If you have some sort of internet connectivity on your Raspberry Pi device, all you need to do is make a request to the firebase API.
Firebase(Google服务器)将通过向所有已注册的设备推送通知来处理其余部分.
Firebase (Google servers) will handle the rest by pushing notifications to all the registered devices.
这篇关于Firebase Cloud Messaging是否需要服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!