[英]How to send notifications from server to React Native app on Android?
i'm learning how to devellop in React-Native a little app forAndroid and i would like to know if it was possible to "link" the app to a server so when the server create an event, the app receive it as a notification. 我正在学习如何在React-Native中为Android开发一个小应用程序,我想知道是否有可能将该应用程序“链接”到服务器,以便当服务器创建事件时,该应用程序将其作为通知接收。 I was thinking to use RxJS but i don't know where to begin. 我当时在考虑使用RxJS,但我不知道从哪里开始。 Is somebody can help me? 有人可以帮助我吗? Thx a lot, Alexandre 非常感谢,亚历山大
EDIT: So in the use, my app would have a "listener" on a website, and then when the site make an alert, the app would react imediatly (if the app is closed, a notification, if it is open, a message is shown. Also , i have to use RxJS or something that is asynchronous , because if not the app would consume a lot of data i suppose. 编辑:因此,在使用中,我的应用程序在网站上会有一个“监听器”,然后当该站点发出警报时,该应用程序将立即做出反应(如果该应用程序关闭,则发出通知,如果打开,则显示一条消息另外,我必须使用RxJS或异步的东西,因为如果不这样做,该应用程序将消耗大量的数据。
I you have a way to do it, then i'll take it 我你有办法做到,那我就接受
You can use react-native-fcm . 您可以使用react-native-fcm 。 I'm using im my applications to notify the user by chat messages and scheduled notifications from server as well. 我正在使用即时通讯应用程序通过聊天消息和来自服务器的预定通知来通知用户。 I think this will help you. 我认为这会对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.