1

Is it possible to push web notification in Firebase for anonymous users with using just the UID because there will be no tokens for anonymous authentication.

1 Answers1

0

The firebase authentication UID are not related to the tokens you get from the WebPush subscription.

That means you can subscribe any kind of user with webpush as described here, and don't even think about firebase authentication.

  • okey what about the guests, or the anonymous users ? is it possible to push a notifications to their devices ? even they are not surfing the website the time the notification pushed ? – Ehab Aboshehab Oct 26 '18 at 04:41
  • Yes, that is possible. You only need the permission from the browser and then you can send notifications to them. I can recommend to do this codelab https://codelabs.developers.google.com/codelabs/push-notifications/#0 - it covers the subscription process and sending the push notification. – Marco Pöhler Oct 29 '18 at 15:21
  • even the browser is closed ? – Ehab Aboshehab Oct 30 '18 at 09:06
  • No. If the browser is really closed, the notification can't be received and is queue in the push service until it can be delivered or the message expired. See details here: https://developers.google.com/web/fundamentals/push-notifications/faq, section "Why doesn't push work when the browser is closed?" – Marco Pöhler Nov 05 '18 at 20:48