Greetings,
I am trying to implement a feature staff communications within the application. I have to implement a real time chat, message notifications and incoming call notifications.
FCM web notifications were used to implement the application until I found out that the notification permissions are not granted and FCM does not work in the Chrome Incognito mode.
As I found out in the stackoverflow FCM has a different behaviour than the other Firebase services and thus it has this specific issue when it tries to run in the Incognito mode.
"The FCM client works on the promise that it can identify your browser, even when the page is not open. So it needs to persistently be able to identify the browser. It uses an Instance Token for that, which I assume it persists in the local storage of your browser. And since an incognito window has its own local storage, it becomes a separate instance ID.
The Firebase Realtime Database itself does not persist any information about the instance. Instead you pass in all the necessary information when you initialize the FirebaseApp instance, and then get a DatabaseReference. Since the incognito window runs the same code, it’s accessing the same information in the database, and thus seeing the same result.
Note that this would be different if you use Firebase Authentication in combination with the Realtime Database. Auth will persist the user token to local storage, so that won’t be shared with the incognito window."
My concerns are as follows.
- Is there any way that we can get FCM working in the incognito mode without the notification permissions issue?
- What are the alternative options to firebase cloud messaging? (Websocket is one, but I favored firebase because with Websocket we have to handle socket disconnections, socketId, etc.)
- How does the popular applications that use firebase behave in the incognito mode?
Thanks.