Skip to content

Best way to determine specific errors? #45

@jstansbe

Description

@jstansbe

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"
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions