Is firebase cloud messaging reliable for developing a chat system in web apps?

291 views
Skip to first unread message

Erfan Samieyan

unread,
Apr 17, 2021, 11:11:38 AM4/17/21
to Firebase Google Group

Hey there. I want to add a chat module on our web app. Our platform uses FCM for push notifications. But as far as I know (this might help) FCM requires user allowance for notifications on browsers. If user blocks notifications (which is quite common) there would be no way that we can send push messages to client (neither background nor foreground). It makes sense that users don't want to get system notifications by browsers. But FCM wouldn't work without the permission even on foreground, because no token would be generated. But as you know in web we can send messages to client with other methods like websockets or subscription and no permission is needed. But in FCM it's kinda all or nothing.

So I thought FCM may not be reliable for developing a messaging module since all its functionality relies on user notification permission that can simply be denied.

Am I understanding the whole system of FCM correctly or there is something that I'm missing? If it is an actual issue, do you have any suggestion or workaround?

Roger Hopkins

unread,
Apr 18, 2021, 5:41:15 PM4/18/21
to Firebase Google Group
The Firebase team will probably provide their guidance but the problem you'll run into is that not all browsers support push notifications (like FCM). The main culprit being Safari on both desktop and iOS.

I implemented a chat feature in one of my Vue apps using Firestore.  Below are links to the chat page and message components in my GitHub repository:

The messages collection has these fields:
avatar,
playerName,
text,
timestamp,
uid (userID)

Hope this helps.
Reply all
Reply to author
Forward
0 new messages