-
Notifications
You must be signed in to change notification settings - Fork 875
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
[FCM] updateToken
always blocked by CORS
#8225
Comments
Checked server stats, fm server has been serving patch to the |
@zwu52 - Thanks for checking! But this has been a recurring issue for the past couple weeks. Just to make sure, does the following endpoint allow PATCH under Access-Control-Allow-Methods?
|
Operating System
MacOS Sonoma 14.4.1
Browser Version
Chrome/124.0.6367.92
Firebase SDK Version
10.8.0
Firebase SDK Product:
Messaging
Describe your project's tooling
Next.js app
Describe the problem
When
getToken
is called with an expired FCM token, the SDK attempts to update the token by making a call toupdateToken
, which sends a PATCH request to the Firebase backend. However, this update sequence always fails due to the following CORS error:Access to fetch at 'https://fcmregistrations.googleapis.com/v1/projects/{projectId}/registrations/{token}' from origin '...' has been blocked by CORS policy: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response.
Is the PATCH method missing from the allowed methods list of this endpoint?
Since the token expiry is set to one week, this issue is not easy to reproduce. However, a subsequent call to
getToken
(refreshing the page in our case) seems to work fine.Steps and code to reproduce issue
getToken
getToken
getToken
fails at PATCH request due to CORSThe text was updated successfully, but these errors were encountered: