bytefish / FcmSharp

Firebase Cloud Messaging (FCM) with .NET
MIT License
6 stars 7 forks source link

404 Requested Entity Was Not Found? #48

Closed AsteaDevelopment closed 5 years ago

AsteaDevelopment commented 5 years ago

Hello,

I am receiving the following response when using FcmSharp. This was not the case 1-2 months ago, I just started doing some recent testing and this is the case. Is there an easy work around for this? Google search says it is related to expired tokens, but it looks like FcmSharp handles that.

{ "error": { "code": 404, "message": "Requested entity was not found.", "errors": [ { "message": "Requested entity was not found.", "domain": "global", "reason": "notFound" } ], "status": "NOT_FOUND" } }

AsteaDevelopment commented 5 years ago

I also verified my service account.json file, it is using the latest possible.

bytefish commented 5 years ago

Thanks for the Bug Report. I will look into it, but it may take a day or two.

bytefish commented 5 years ago

@AsteaDevelopment It looks like this is the expected response, when the device is not registered: https://stackoverflow.com/a/49075681/513875. One could map the NOT_FOUND to something different I think. But technically, this is not a Bug.

There is a Pull Request by @sir-boformer to improve the Error handling: https://github.com/bytefish/FcmSharp/pull/38, which makes it a little easier to handle these errors. I will see if I merge it this weekend, but I need to review it first.

AsteaDevelopment commented 5 years ago

@bytefish, thanks. I do not understand how it is not registered though. The client I can see a registration id token being generated. I am using the phonegap push plugin, maybe a problem on their end then?

bytefish commented 5 years ago

@AsteaDevelopment I am not sure. Maybe you double check if you are using the correct token? I think you can also send Push Messages from the Firebase Console Website. Maybe you can try to send a message with it for the problematic token and see what it outputs? It probably gives additional errors.

kehollin commented 5 years ago

I get a 404 when I delete the app from my phone, so yeah could definitely be an invalid token.

On Dec 7, 2018 12:46 PM, "Philipp Wagner" notifications@github.com wrote:

@AsteaDevelopment https://github.com/AsteaDevelopment I am not sure. Maybe you double check if you are using the correct token? I think you can also send Push Messages from the Firebase Console Website. Maybe you can try to send a message with it for the problematic token and see what it outputs? It probably gives additional errors.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bytefish/FcmSharp/issues/48#issuecomment-445344576, or mute the thread https://github.com/notifications/unsubscribe-auth/AExGMXdKKmT2P-KFI2x3WSkLLe1P3JWGks5u2sV3gaJpZM4ZI1Ld .

bytefish commented 5 years ago

@kehollin Thanks a lot for your feedback! I welcome your contributions. 👍 Because the Firebase documentation is sometimes a little sparse, so your experience is very useful.

bytefish commented 5 years ago

I am closing the issue, because I think the 404 is a valid return code from Firebase and occurs, when the Token is invalid... for example due to uninstalling the app. @AsteaDevelopment Please reopen, if you can reproduce the problem and identify it is a problem in FcmSharp. At the moment I don't think there is a problem on my side.