silhouette hustler
silhouette hustler

Reputation: 1763

Getting Unauthorized 401 for manifest.json GCM push notifications in ASP.NET

My manifest file is in the root folder, referenced in the _Layout view as following:

<link rel="manifest" href="~/manifest.json">

The file structure is as following:

{
"gcm_sender_id": "MY_Sender_Id",
"permissions": [
"gcm"
] 
}

Keep getting 401 unauthorized, in chrome dev tools under the application tab, this is what I get:

enter image description here

Upvotes: 2

Views: 5378

Answers (1)

AL.
AL.

Reputation: 37778

When using FCM for Web, the value for gcm_sender_id is fixed. From the docs:

{
  "//": "Some browsers will use this to enable push notifications.",
  "//": "It is the same for all projects, this is not your project's sender ID",
  "gcm_sender_id": "103953800507"
}

Don't confuse the "browser sender ID" with the project-specific sender ID value shown in your Firebase project settings. The browser sender ID for manifest.json is a fixed value, common among all FCM JavaScript clients.

Upvotes: 3

Related Questions