Firebase & One Signal Push Notifications Guidance

…衆ロ難τιáo~ 提交于 2020-08-10 23:07:30

问题


I have been playing around with One Signal & Firebase Push Notification.

I am almost sure One Signal cannot help me and am starting to feel Firebase might also not be able to help me.

We have a web app that allows regular authors to post articles. It also allows users to comment on the article using Firebase synced realtime database.

I want to create functionality where users can get a push notification for article-specific comment treads. The room ID will be the article ID. If both allow push notification generally from our app and has commented on an article, they subscribe to this article comment tread solely. They can also click a button at this specific article comment thread and unsubscribe to this article comment thread if they want.

So we may have thousands of articles and hundreds of comments in each article, to put it lightly.

I quickly moved away from One Signal when I didn't feel like I could have a separate "Segment" for each article, I wasn't certain this is allowed? Thoughts there?

Throughout my exploration of Firebase I just came across this comment in their documentation in relation to groups (Which I was hoping could be my article room).

"The maximum number of members allowed for a notification key is 20" found here. A key is a group key from my understanding. This won't work because what if there are more than 20 users in a comment thread. I looked up the most popular commented threads ever to find numbers like 500. This means my system would have to be able to support large numbers of users per article tread.

Additionally One Signal Tags and Social activities look like could be investigated, but my general question is not specific, its more a wider general question. I am hoping someone with experience can give some guidance and good tips on best way to approach this problem. Are Push notification even allowed on such a scale I am wondering?

A scaling examples 1000 Articles with 100s of different users commenting on each article. A user may only receive a push notification on articles which he has commented in only. (Assuming he has allowed push notification site-wide first and not blocked us or unsubscribed from the site entirely. Subscribing to the site doesn't automatically subscribe you to anything specific, just means you willing to be subscribed to something and have control which things easily)

Ok thanks for reading and looking forward to hearing from someone with this experience and share their experience.

Daniel Gadd @ GaddBox


回答1:


Maybe it's a bit late.

You have to use topics.

FCM topic messaging allows you to send a message to multiple devices that have opted in to a particular topic. You compose topic messages as needed, and FCM handles routing and delivering the message reliably to the right devices.

In your case, every Article is a topic.



来源:https://stackoverflow.com/questions/61938591/firebase-one-signal-push-notifications-guidance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!