From d04c323160bd6bfec7f1e8b2891d7538788a7257 Mon Sep 17 00:00:00 2001 From: hiranya911 Date: Thu, 8 Feb 2018 12:42:37 -0800 Subject: [PATCH 1/2] Using new FCM error codes --- src/utils/error.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/error.ts b/src/utils/error.ts index 721614dc36..9d090e72a1 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -610,14 +610,14 @@ const MESSAGING_SERVER_TO_CLIENT_CODE: ServerToClientCode = { InvalidApnsCredential: 'INVALID_APNS_CREDENTIALS', /* FCM new server API error codes */ - NOT_FOUND: 'REGISTRATION_TOKEN_NOT_REGISTERED', + UNREGISTERED: 'REGISTRATION_TOKEN_NOT_REGISTERED', INVALID_ARGUMENT: 'INVALID_ARGUMENT', - RESOURCE_EXHAUSTED: 'TOO_MANY_TOPICS', - PERMISSION_DENIED: 'AUTHENTICATION_ERROR', - UNAUTHENTICATED: 'AUTHENTICATION_ERROR', + QUOTA_EXCEEDED: 'DEVICE_MESSAGE_RATE_EXCEEDED', + SENDER_ID_MISMATCH: 'MISMATCHED_CREDENTIAL', + APNS_AUTH_ERROR: 'INVALID_APNS_CREDENTIALS', UNAVAILABLE: 'SERVER_UNAVAILABLE', INTERNAL: 'INTERNAL_ERROR', - UNKNOWN: 'UNKNOWN_ERROR', + UNSPECIFIED_ERROR: 'UNKNOWN_ERROR', }; /** @const {ServerToClientCode} Topic management (IID) server to client enum error codes. */ From ec202b7927c4e4cb3d24272c9c06b63f4c75b5b0 Mon Sep 17 00:00:00 2001 From: hiranya911 Date: Thu, 8 Feb 2018 13:39:56 -0800 Subject: [PATCH 2/2] Adding new SDK error code message-rate-exceeded --- src/utils/error.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/error.ts b/src/utils/error.ts index 9d090e72a1..986a4e6770 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -484,6 +484,10 @@ export class MessagingClientErrorCode { message: 'The rate of messages to subscribers to a particular topic is too high. Reduce the ' + 'number of messages sent for this topic, and do not immediately retry sending to this topic.', }; + public static MESSAGE_RATE_EXCEEDED = { + code: 'message-rate-exceeded', + message: 'Sending limit exceeded for the message target.', + }; public static INVALID_APNS_CREDENTIALS = { code: 'invalid-apns-credentials', message: 'A message targeted to an iOS device could not be sent because the required APNs ' + @@ -612,7 +616,7 @@ const MESSAGING_SERVER_TO_CLIENT_CODE: ServerToClientCode = { /* FCM new server API error codes */ UNREGISTERED: 'REGISTRATION_TOKEN_NOT_REGISTERED', INVALID_ARGUMENT: 'INVALID_ARGUMENT', - QUOTA_EXCEEDED: 'DEVICE_MESSAGE_RATE_EXCEEDED', + QUOTA_EXCEEDED: 'MESSAGE_RATE_EXCEEDED', SENDER_ID_MISMATCH: 'MISMATCHED_CREDENTIAL', APNS_AUTH_ERROR: 'INVALID_APNS_CREDENTIALS', UNAVAILABLE: 'SERVER_UNAVAILABLE',