1
votes

In other words, I would like to use Firebase Cloud Messaging (FCM) from AngularJS to implement real-time chat. If I understand it properly, this is not possible yet -- please correct me if I am wrong.

Currently two-way messaging (receive and send messages) via FCM can be done in Android SDK, iOS SDK, in Chrome Apps and Chrome plugins. However JS frameworks (which fall under "Websites in Chrome") can benefit only from one-way push notifications, as stated here:

Websites in Chrome can implement push messaging through service workers and web app manifests following the Webpush standard.

1
Peter where you able to successfully implement FCM on a webapp? I have been struggling with it I followed the codelabs example of push notification in webapp example and i'm using Server key from firebase console and i keep getting 401 error when i try to http POST - jasan
Jasan, I did not used FCM at the end and successfully used Firebase Realtime Database as suggested Ian. - Peter

1 Answers

3
votes

FCM is not a good solution for two way chat on the web - exactly as you say, it is focused on push messaging.

However, the Firebase Realtime Database is a great tool for this kind of app! If you take a look at the Firebase Friendly Chat Codelab it leads you through building a chat client.