user14943711
user14943711

Reputation:

Flutter - How to integrate automatic push notifications

I have already built a chat app to practice flutter and I would really like to integrate push notifications that notify the users when a new message is sent but I don't seem to find any relevant information on the internet about this topic, I am currently using firebase. what can I do in order to achieve this functionality?

Upvotes: 2

Views: 1056

Answers (2)

Amit Singh
Amit Singh

Reputation: 753

you have to use firebase cloud messaging by you have to safe each user token id

that will be notify users for a particular event

check my repository in developer branch where I implement push notification by

using firebase cloud messaging

my repository for push notification

Upvotes: 1

actuallymicah
actuallymicah

Reputation: 709

Since you are already using firebase, look into Firebase Cloud Messaging. You'll need to

  1. Save each user's device tokens in Cloud Firestore and Realtime Database
  2. When a message is sent/written to the database, trigger a cloud function to send a notification through Cloud Messaging.

Upvotes: 2

Related Questions