From a27131094d1c0a540f37f0d64c8fdbe3ce40a00a Mon Sep 17 00:00:00 2001 From: Doris Ge Date: Mon, 27 Feb 2023 23:42:13 -0800 Subject: [PATCH] Deprecate sendToDevice and sendToDeviceGroup and their response classes 1. Deprecate sendToDevice and its response class, MessagingDeviceResponse 2. Deprecate sendToDeviceGroup and its response class, MessagingDeviceGroupResponse --- src/messaging/messaging-api.ts | 10 +++++++++- src/messaging/messaging.ts | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/messaging/messaging-api.ts b/src/messaging/messaging-api.ts index d41e6a61c2..2eafeb4434 100644 --- a/src/messaging/messaging-api.ts +++ b/src/messaging/messaging-api.ts @@ -940,7 +940,11 @@ export interface MessagingOptions { [key: string]: any | undefined; } -/* Individual status response payload from single devices */ +/** + * Individual status response payload from single devices + * + * @deprecated Returned by {@link firebase-admin.messaging#sendToDevice} which is also deprecated. + */ export interface MessagingDeviceResult { /** * The error that occurred when processing the message for the recipient. @@ -967,6 +971,8 @@ export interface MessagingDeviceResult { * See * {@link https://firebase.google.com/docs/cloud-messaging/admin/send-messages#send_to_individual_devices | * Send to individual devices} for code samples and detailed documentation. + * + * @deprecated Returned by {@link firebase-admin.messaging#sendToDevice} which is also deprecated. */ export interface MessagingDevicesResponse { canonicalRegistrationTokenCount: number; @@ -983,6 +989,8 @@ export interface MessagingDevicesResponse { * See * {@link https://firebase.google.com/docs/cloud-messaging/send-message?authuser=0#send_messages_to_device_groups | * Send messages to device groups} for code samples and detailed documentation. + * + * @deprecated Returned by {@link firebase-admin.messaging#sendToDeviceGroup} which is also deprecated. */ export interface MessagingDeviceGroupResponse { diff --git a/src/messaging/messaging.ts b/src/messaging/messaging.ts index c208a34a79..3edd9daba9 100644 --- a/src/messaging/messaging.ts +++ b/src/messaging/messaging.ts @@ -376,6 +376,8 @@ export class Messaging { * * @returns A promise fulfilled with the server's response after the message * has been sent. + * + * @deprecated Use {@link firebase-admin.messaging#send} instead. */ public sendToDevice( registrationTokenOrTokens: string | string[], @@ -445,6 +447,8 @@ export class Messaging { * * @returns A promise fulfilled with the server's response after the message * has been sent. + * + * @deprecated Use {@link firebase-admin.messaging#send} instead. */ public sendToDeviceGroup( notificationKey: string,