Can I send fcm notifications to Firebase UserIds instead of device tokens?

Viewed 125

I see examples where you have to extract device tokens and store them in a db to be able to send notifications to that device.

I wondered if I could use Firebase user ids to send a select list of users notifications skipping the need for tokens?

2 Answers

No, you can't. You need to implement a custom notification sender from the firebase cloud function to send by user IDs. But you can't ignore the FCM tokens. You must register a valid FCM token of the user's device to trigger per device notification. Check the following guideline:

FCM Push Notifications for Flutter

Related