Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Cloud Messaging token sometimes invalid #821

Open
fanesz opened this issue Aug 15, 2024 · 0 comments
Open

Firebase Cloud Messaging token sometimes invalid #821

fanesz opened this issue Aug 15, 2024 · 0 comments

Comments

@fanesz
Copy link

fanesz commented Aug 15, 2024

Step 1: Describe your environment

  • Operating system: Android/Windows
  • Browser: MSEdge/Chrome
  • Firebase SDK version: firebase_messaging: ^14.7.10 / firebase_core: ^2.24.2

Step 2: Describe the problem:

I have restful backend app with auth system, where when user log-in,
backend will validate the fcm by fetch with POST method to https://fcm.googleapis.com/fcm/send
With payload like this:
{ "registration_ids": [ "fcm_token..." ] }

The problem is, sometime it return failure status 1 on first check, but on second/third check, it return succes status 1.

image

Steps to reproduce:

  1. Get the fcm token from android app (flutter)
  2. Fetch with POST method to https://fcm.googleapis.com/fcm/send with payload: { "registration_ids": [ "fcm_token..." ] } (with backend or postman, doesn't matter)
  3. Randomly return failure status: 1

Observed Results:

I have no idea why is this happen, but mostly happen on first validate (when the token is not validated for a while).
It also happen when I spam fetch it, it give a failure result around 1/10.

Expected Results:

Not return failure status=1 because the token is still valid

Relevant Code:

-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant