firebase-admin-dotnet: Best way to determine specific errors?
I’m trying to determine when there is an invalid token, an expired token, message rate exceeded error, etc. (https://firebase.google.com/docs/cloud-messaging/send-message#admin_sdk_error_reference).
When i send a single message/notification to a token like so:
var response = await FirebaseMessaging.DefaultInstance.SendAsync(message);
I get the following response (I’m getting this when i catch a thrown exception from FirebaseMessaging… I think i must be using this incorrectly as this seems strange… shouldn’t there be a response object?).
What am I doing that is incorrect? Shouldn’t I be able to find a code that matches to whats in the admin_sdk_error_reference section? (link i have above)
Response status code does not indicate success: 400 (BadRequest)
{
"error": {
"code": 400,
"message": "The registration token is not a valid FCM registration token",
"errors": [
{
"message": "The registration token is not a valid FCM registration token",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 26 (11 by maintainers)
@swebgit They will be released incrementally over a series of releases.
Note that the FCM APIs now support the fine-grained error handling scheme outlined above.
FirebaseMessagingExceptionandMessagingErrorCodetypes were included in the v1.8 release. More to come.Thanks for the info regarding this @hiranya911. I’m looking forward to being able to handle error codes from the Admin SDK more easily in .NET!