Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
how to manage and send notifications to multiple devices a user is logged in?

I'm developing an application having a Mobile App and a Web Panel, on which a user can log in on multiple devices at the same time. I'm using Firebase Cloud Messaging to send notifications.

So currently to send notifications I'm storing the Firebase Cloud Messaging token in an array and sending notifications by looping through that array e.g users can open the same account on 2 browsers/laptops + log in to 3 different mobile devices with the same account, so 5 different tokens will be stored in the database. Every time a user opens a mobile app it gets a new token which is saved in the DB. I'm not removing any token at any time.

So there will be a bulk of tokens collecting in my DB, which will take more and more time in sending notifications to a specific user on all the tokens.

So I want to know how can I manage these tokens? how can I validate? because I'm not removing tokens, notification sending requests always return 200. Should I use topic instead of tokens but how will I unsubscribe a user from the server-side.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could create multiple attributes (instead of a string array) in the database (tokenFromAndroid, tokenFromIos, tokenFromWeb, etc.. other platforms). Every time you call the Firebase SDK to generate the token you could update the respective attribute in the database so the token is always the newest for that platform. In this case you would not have too many tokens for one user.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!