messagingServerToClientCode top-level constant

  1. @internal
Map<String, MessagingClientErrorCode> const messagingServerToClientCode

Messaging server to client enum error codes.

Implementation

@internal
const messagingServerToClientCode = {
  /* GENERIC ERRORS */
  // Generic invalid message parameter provided.
  'InvalidParameters': MessagingClientErrorCode.invalidArgument,
  // Mismatched sender ID.
  'MismatchSenderId': MessagingClientErrorCode.mismatchedCredential,
  // FCM server unavailable.
  'Unavailable': MessagingClientErrorCode.serverUnavailable,
  // FCM server internal error.
  'InternalServerError': MessagingClientErrorCode.internalError,

  /* SEND ERRORS */
  // Invalid registration token format.
  'InvalidRegistration': MessagingClientErrorCode.invalidRegistrationToken,
  // Registration token is not registered.
  'NotRegistered': MessagingClientErrorCode.registrationTokenNotRegistered,
  // Registration token does not match restricted package name.
  'InvalidPackageName': MessagingClientErrorCode.invalidPackageName,
  // Message payload size limit exceeded.
  'MessageTooBig': MessagingClientErrorCode.payloadSizeLimitExceeded,
  // Invalid key in the data message payload.
  'InvalidDataKey': MessagingClientErrorCode.invalidDataPayloadKey,
  // Invalid time to live option.
  'InvalidTtl': MessagingClientErrorCode.invalidOptions,
  // Device message rate exceeded.
  'DeviceMessageRateExceeded':
      MessagingClientErrorCode.deviceMessageRateExceeded,
  // Topics message rate exceeded.
  'TopicsMessageRateExceeded':
      MessagingClientErrorCode.topicsMessageRateExceeded,
  // Invalid APNs credentials.
  'InvalidApnsCredential': MessagingClientErrorCode.thirdPartyAuthError,

  /* FCM v1 canonical error codes */
  'NOT_FOUND': MessagingClientErrorCode.registrationTokenNotRegistered,
  'PERMISSION_DENIED': MessagingClientErrorCode.mismatchedCredential,
  'RESOURCE_EXHAUSTED': MessagingClientErrorCode.messageRateExceeded,
  'UNAUTHENTICATED': MessagingClientErrorCode.thirdPartyAuthError,

  /* FCM v1 new error codes */
  'APNS_AUTH_ERROR': MessagingClientErrorCode.thirdPartyAuthError,
  'INTERNAL': MessagingClientErrorCode.internalError,
  'INVALID_ARGUMENT': MessagingClientErrorCode.invalidArgument,
  'QUOTA_EXCEEDED': MessagingClientErrorCode.messageRateExceeded,
  'SENDER_ID_MISMATCH': MessagingClientErrorCode.mismatchedCredential,
  'THIRD_PARTY_AUTH_ERROR': MessagingClientErrorCode.thirdPartyAuthError,
  'UNAVAILABLE': MessagingClientErrorCode.serverUnavailable,
  'UNREGISTERED': MessagingClientErrorCode.registrationTokenNotRegistered,
  'UNSPECIFIED_ERROR': MessagingClientErrorCode.unknownError,
};