简体   繁体   English

快速从用户到用户Firebase发送推送通知

[英]Swift Send Push Notification from user to user Firebase

I am creating an app using Swift and Firebase. 我正在使用Swift和Firebase创建一个应用程序。 When the user presses a button the app will upload some data to the real time database and send another user a Push Notification. 当用户按下按钮时,应用程序会将一些数据上传到实时数据库,并向其他用户发送“推送通知”。 Is possible by making the other user subscribe to the changes in the realtime database or will this not check for changes when the app is not in the foreground? 是否可以通过让其他用户订阅实时数据库中的更改来解决?如果应用程序不在前台,是否可以不检查更改?

Should I upload the data then use Cloud Messaging to alert the user of the new data? 我是否应该上传数据,然后使用Cloud Messaging提醒用户新数据?

Thank you 谢谢

You should use FCM for this use case. 您应该在此用例中使用FCM。 Having the app listen for changes to the database while in the background is not good for device battery, so you should have your application server listen to the database for changes then send appropriate FCM messages to let the client app know that there are changes. 让应用程序在后台监听数据库的更改不利于设备电池,因此您应该让应用程序服务器监听数据库的更改,然后发送适当的FCM消息以使客户端应用程序知道有更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase、Swift:向给定设备令牌的特定用户发送推送通知 - Firebase, Swift: Send a push notification to specific user given device token 如何在用户之间发送推送通知? - How to send push notification from user to user? 如何在 iOS 中使用 Google Firebase 向特定用户发送推送通知? - How to send push notification to a specific user using Google Firebase in iOS? 无法使用Parse向单个用户发送推送通知-Swift - Unable to send push notification to a single user with Parse - Swift 使用解析将用户的推送通知发送给另一个用户 - Send a push notification from a user to another using parse 无法从 Spring 引导向 FCM 和远程用户发送推送通知? - Cannot send push notification to FCM and to remote user from Spring Boot? (快速3)我需要向用户发送通知,以在特定时间打开应用。 更好地使用本地或推送通知? - (Swift 3) I need to send a notification to the user to open the app at a specific time. Better to use a local or push notification? iOS Firebase 推送通知:如何提供 Firebase 用户的设备令牌并发送通知 - iOS Firebase Push Notifications : How To Give Firebase User's Device Token And Send Notification 检查Swift中推送通知的用户设置 - Check user settings for push notification in Swift 向特定用户发送远程推送通知 - Send remote push notification to specific user
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM