Flutter - push firebase notifications to specific users without firebase auth

3,453

The push notifications are not sent based on user, they are sent based on push notification token that is received when you register for push notifications (iOS & Android).

The push notification token will change in the case of uninstall/install and has nothing to do with what user is logged in in the app, you can send push notifications to apps that don't have users at all.

In order to target a specific user with push notification, you must do something called user segmentation, that is, filter user based on particular properties of these users. In general user segmentation is done by tracking user action and user properties and depends on the push notification platform in use. For example you can track user actions in the app, like user added product to cart, user has x products in cart and then send a push notification to all users that have more than 3 products in cart.

All the push notifications platform link the push notification token to the events triggered.

If you are using firebase, the most easiest way is to track user properties, there are a lot of tutorials on this part. Although, in my opinion, firebase tracking is kind of crappy.

One thing to note, since the push notification token is not linked to the user directly, in case there are two users (two accounts) using the same device they, they will receive push notifications on the same device, so don't send sensitive information via push notifications.

Share:
3,453
Thomas Nicole
Author by

Thomas Nicole

Mobile and Web developer. Currently, I am working with Flutter.

Updated on December 10, 2022

Comments

  • Thomas Nicole
    Thomas Nicole over 1 year

    I am working with Firebase to push notifications and I don't use Firebase authentication on my app (I have my own system).

    I didn't find an answer to this question: Is it possible to push notifications to a specific user with firebase without Firebase authentication (and therefore, without a UID)? How?