Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

223
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda