使用Firebase和OneSignal推送通知 [英] Push Notifications with Firebase and OneSignal

查看:260
本文介绍了使用Firebase和OneSignal推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些指导.

I'm looking for some guidance.

我将Firebase用作正在构建的应用程序的后端服务器,当有人喜欢或不喜欢用户生成的某些内容时,我想提醒用户.

I'm using Firebase as the backend server for an app I'm building and I would like to alert users when somebody has either liked or disliked some content the user generated.

我了解到Firebase提供了云消息传递,通过该消息传递,我可以针对非常特定的用户并向他们发送更新;我已经实现了该功能.但是,我想根据数据库中的更改发送更新,据我所知,FCM不是为此目的而构建的.

I understand that Firebase offers cloud messaging through which I can target very specific users and send updates to them; I have implemented that functionality. However, I would like to send updates based on changes in the database, and, as far as I understand, FCM is not built for this purpose.

我遇到过OneSignal,这似乎很有希望.有没有人用Firebase实现此功能,它可以满足我的需求吗?

I have come across OneSignal and it seems promising. Has anybody implemented this with Firebase and could it do what I'm looking for?

谢谢!

推荐答案

我将其设置为当用户将消息发送给另一个用户时,也会通过OneSignal发送通知.您只需要将OneSignal userId存储在具有Firebase用户UID的节点中. 如果您喜欢某人的内容,那么它还会将通知直接发送给其他用户.

I have it set upon such a way that when a message is send by a user to another user, a notification is also send via OneSignal. You just need to store the OneSignal userId in a node with the firebase user UID. I you like someone's content, then that would also send a notification out directly to the other user.

这篇关于使用Firebase和OneSignal推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆