question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase 404 NOT_FOUND

See original GitHub issue

I am trying to implement firebase admin into ASP.NET core but I am missing something… Everytime I run my code I get the following error:

Response status code does not indicate success: 404 (NotFound)
{
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "errors": [
      {
        "message": "Requested entity was not found.",
        "domain": "global",
        "reason": "notFound"
      }
    ],
    "status": "NOT_FOUND"
  }
}

The code that I am running:

var message = new Message
{
    Token = fcmToken,
    Data = new Dictionary<string, string>
    {
        {"title", notification.Title},
        {"body", notification.Message},
        {"channel", notification.Channel},
        {"level", ((int)notification.Level).ToString()},
        {"link", notification.Link}
    }
};

try
{
    var fcmResult = await FirebaseMessaging.DefaultInstance.SendAsync(message);
}
catch (Exception ex)
{

}

Registration:

if (FirebaseApp.DefaultInstance == null)
{
    FirebaseApp.Create(new AppOptions
    {
        Credential = GoogleCredential.FromJson(Settings.Default.Firebase_Server_Auth)
    });
}

Github link: https://github.com/kevingoos/FirebaseAdminTest Stackoverflow: https://stackoverflow.com/questions/56499904/firebaseadmin-messaging-returning-404-not-found

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hiranya911commented, Jun 11, 2019

This happens when the token is invalid/expired or does not belong to the same project as the credentials used to initialize the Admin SDK.

0reactions
hiranya911commented, Jan 9, 2021

It’s most likely a matter of expired or invalid FCM registration token. Make sure the token is up-to-date (this needs to be handled at the client side), and the token belongs to the same project as the service account.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase hosting deploy error "HTTP Error: 404, Not Found"
But I'm unable to deploy my files to a hosting project. The output after I type firebase deploy: === Deploying to 'legofun-8f22d'... i...
Read more >
Failed to create a record in Firebase/Firestore. Error code ...
That is most likely why the error message that we're getting is error 404 (not found) as the test item is in a...
Read more >
Configure Hosting behavior - Firebase - Google
You can serve a custom 404 Not Found error when a user tries to access a page that doesn't exist. Create a new...
Read more >
Firebase hosting: HTTP Error: 404, Requested entity was ...
Everything was working just fine yesterday. Last thing I did yesterday was to deploy the app and then update the firebase-tools to its ......
Read more >
Error 404 on command firebase init
Hi! I've encountering this problem while using the Firebase Init command. The setup works perfectly until the second login to Github (the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found