Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Notification - send to user segment vs send to topic difference

I am assigned a task to use Firebase to implement push notifications but I am kind of new this.

Looking at the documentation:

https://firebase.google.com/docs/notifications/android/console-audience

I can't tell under what circumstances should I use send to user segment or send to a topic.

Can someone please give me some example when to use one or the other and point out the difference? Thanks ahead :)

like image 535
Tom Avatar asked Dec 19 '22 11:12

Tom


2 Answers

User Segments

  • You can only send notifications to User Segments via the Firebase Console. (see here).
  • Limited to specific targets (from the docs you linked):

    Select the message target. The dialog displays further options to refine the target based on whether you choose App/App Version, Device Language, or Users in Audience.

  • As also already mentioned in the doc you linked:

    You can target predefined user segments or custom audiences created in Firebase Analytics.

Topics

  • Token/device management not necessarily required.
  • Unlimited number of subscribers.
  • Can send to topics using the FCM API.
  • Can easily subscribe/unsubscribe via the client app.

IMHO, if you want things to be quick and simple, go with Topic Messaging.

like image 115
AL. Avatar answered Mar 30 '23 01:03

AL.


Use User segements

  • To typically send push notifications to a specific and limited set of devices.
  • Message delivery is almost instantaneous (in my experience). Also, I haven't observed throttling as was the case earlier with GCM.

Use Topics

  • Topic or publish/subscribe mechanism is used for a comparatively larger audience and the information type is public. Examples are weather and news.
  • Topics have latency (Message delivery may be throttled)
like image 37
Pravin Sonawane Avatar answered Mar 29 '23 23:03

Pravin Sonawane