无需中间服务器的实时通信
Real-time communication without requiring a server in-between
所以我正在尝试构建一个使用 firebase 实时数据库的应用程序。数据库有这个巧妙的功能,可以监听特定子节点的变化。据我所知,这只有在应用程序处于前台且未关闭时才有效,对吗?
问题是,如果应用程序在后台运行,我想为特定用户触发通知。这不适用于数据库,因为应用程序已关闭。显然,在这种情况下我需要使用云消息传递来唤醒设备并显示通知。我可以通过 node.js 收听我的实时数据库中的变化,然后向用户发送推送通知 => 这需要中间的服务器,我尽量避免。
有什么办法可以实现吗
- 当应用程序在前台时 => 通过实时触发更改
数据库
- 当应用程序在后台时 => 通过云显示通知
消息
我自己没有服务器,仅使用 firebase technology? Hosting only serves static files and storage 是(很好)仅用于存储图像等文件。
正如我在评论中指出的那样,并且@Frank 同意我的看法,目前您唯一可以在没有服务器的情况下做的事情 - 将数据库侦听器置于服务中,但这可能会导致电池耗尽。 iOS 你根本没有任何选择。
我 5 天前向 Firebase 发送了功能请求,答案是
Hi Dima,
Thanks for reaching out.
We're definitely aware that many users, such as yourself, would like
this feature. We're exploring potential solutions, but I can't share
any details or timelines at this time. We'll keep your feedback in
consideration moving forward though.
Keep an eye out on our release notes for any further updates.
Regards,
Marcial
27 Aug 2016
所以我正在尝试构建一个使用 firebase 实时数据库的应用程序。数据库有这个巧妙的功能,可以监听特定子节点的变化。据我所知,这只有在应用程序处于前台且未关闭时才有效,对吗?
问题是,如果应用程序在后台运行,我想为特定用户触发通知。这不适用于数据库,因为应用程序已关闭。显然,在这种情况下我需要使用云消息传递来唤醒设备并显示通知。我可以通过 node.js 收听我的实时数据库中的变化,然后向用户发送推送通知 => 这需要中间的服务器,我尽量避免。
有什么办法可以实现吗
- 当应用程序在前台时 => 通过实时触发更改 数据库
- 当应用程序在后台时 => 通过云显示通知 消息
我自己没有服务器,仅使用 firebase technology? Hosting only serves static files and storage 是(很好)仅用于存储图像等文件。
正如我在评论中指出的那样,并且@Frank 同意我的看法,目前您唯一可以在没有服务器的情况下做的事情 - 将数据库侦听器置于服务中,但这可能会导致电池耗尽。 iOS 你根本没有任何选择。
我 5 天前向 Firebase 发送了功能请求,答案是
Hi Dima,
Thanks for reaching out.
We're definitely aware that many users, such as yourself, would like this feature. We're exploring potential solutions, but I can't share any details or timelines at this time. We'll keep your feedback in consideration moving forward though.
Keep an eye out on our release notes for any further updates.
Regards,
Marcial
27 Aug 2016