简体   繁体   English

如何将通知从服务器发送到Android上的React Native应用?

[英]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.

相关问题 如何将来自 django 的推送通知发送到反应原生应用程序? - How to send push notifications from django to a react native app? 如何从 web 应用程序/服务器发送数据以响应本机应用程序? - How to send data from web app/server to react native app? 如何从 React Native App 将我的长度变量发送到我的 HTTPS 服务器 - How do I send out my length variable to my HTTPS server from React Native App 如何以编程方式从 React Native App 发送短信? - How to send sms messages from a React Native App programmatically ? 如何将值从react-native发送到android活动? - How to send a value from react-native to android activity? 从后台反应本机应用程序发送电子邮件 - Send email from a react native app in background 如何在 React Native App 中直接发送电子邮件 - how to send email directly in React Native App 如何将图像从React应用发送到api服务器 - How to send image from React app to api server 向 websocket 服务器 React Native app 发送/写入值 - Send/write value to websocket server React Native app React Native iOS:检查通知权限内存泄漏,如何在应用启动时检查通知权限? - React Native iOS: Check notifications perms memory leak, how to check notifications perms on app launch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM