Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send notification to only one user in firebase [closed]

I have an android app and I want to send notifications to only one user when data is change. How can I do that? I don't want to send my message to all users of my app, just the user whose data changed.

Since Firebase returns a unique registration token created for every device after client initialization, is there any way to send the notification to a particular user or only to a group of Users using that token?

like image 259
Atif Rizwan Avatar asked Jul 17 '17 04:07

Atif Rizwan


People also ask

How do you send push notifications with FCM to specific user in flutter?

This can simply be done by heading to your Firebase project > Project Settings > Cloud Messaging then copy the API key under Cloud Messaging API (Legacy) . When you have your Firebase Cloud Messaging API key, this is the code to display a notification given the notification title, body, and device token to send it to.


1 Answers

You can make topic for this user and subscribe to that topic then Firebase allow us to send message to specific topic using topic message. Kindly Look at this link

https://firebase.google.com/docs/cloud-messaging/android/topic-messaging

and this

How to send notification to specific users with FCM?

Hope it will help .

like image 136
Sardar Khan Avatar answered Oct 24 '22 09:10

Sardar Khan