Lakshan
Lakshan

Reputation: 297

How to send push notification to specific devices

I got two mobile apps for service provider and customer, i need to send push notifications for service provider user once the customer requests a specific service type. So it needs to be filtered and send only for those who can provide such a service. Therefore web api needs to send the notification only for specific users, how can i do that with firebase should i use, device mac or registration id generated by firebase.

Any help

Upvotes: 1

Views: 9217

Answers (2)

Raj Gohel
Raj Gohel

Reputation: 1102

  1. register a new project in FCM console.
  2. Make android/ios and web(for configuration) application.
  3. The first-time app will be loaded it gives device token and store to the database.
  4. by using device token you can send a notification to a particular device.

Reference link:- https://www.djamware.com/post/5c6ccd1f80aca754f7a9d1ec/push-notification-using-ionic-4-and-firebase-cloud-messaging

Upvotes: 3

PrasathBV
PrasathBV

Reputation: 323

  1. First you have to get the fire base token from android app.
  2. Register your mobile app in Firebase console.
  3. If you have any user login api and database, send the fire base token while user login your app and save the token against the user.
  4. Whenever the user request for service you can get the token of the particular user and send a message to fire base api with that token from server side.
  5. It will automatically send the message to that particular device whoever login your app.
  6. Make sure you update the token while if other user login your app in same device.

Upvotes: 1

Related Questions