diff --git a/etc/firebase-admin.api.md b/etc/firebase-admin.api.md index e4675c2009..aa779db0db 100644 --- a/etc/firebase-admin.api.md +++ b/etc/firebase-admin.api.md @@ -370,8 +370,6 @@ export namespace messaging { export type ConditionMessage = ConditionMessage; // Warning: (ae-forgotten-export) The symbol "CriticalSound" needs to be exported by the entry point default-namespace.d.ts export type CriticalSound = CriticalSound; - // Warning: (ae-forgotten-export) The symbol "DataMessagePayload" needs to be exported by the entry point default-namespace.d.ts - export type DataMessagePayload = DataMessagePayload; // Warning: (ae-forgotten-export) The symbol "FcmOptions" needs to be exported by the entry point default-namespace.d.ts export type FcmOptions = FcmOptions; // Warning: (ae-forgotten-export) The symbol "LightSettings" needs to be exported by the entry point default-namespace.d.ts @@ -380,18 +378,12 @@ export namespace messaging { export type Message = Message; // Warning: (ae-forgotten-export) The symbol "Messaging" needs to be exported by the entry point default-namespace.d.ts export type Messaging = Messaging; - // Warning: (ae-forgotten-export) The symbol "MessagingOptions" needs to be exported by the entry point default-namespace.d.ts - export type MessagingOptions = MessagingOptions; - // Warning: (ae-forgotten-export) The symbol "MessagingPayload" needs to be exported by the entry point default-namespace.d.ts - export type MessagingPayload = MessagingPayload; // Warning: (ae-forgotten-export) The symbol "MessagingTopicManagementResponse" needs to be exported by the entry point default-namespace.d.ts export type MessagingTopicManagementResponse = MessagingTopicManagementResponse; // Warning: (ae-forgotten-export) The symbol "MulticastMessage" needs to be exported by the entry point default-namespace.d.ts export type MulticastMessage = MulticastMessage; // Warning: (ae-forgotten-export) The symbol "Notification" needs to be exported by the entry point default-namespace.d.ts export type Notification = Notification; - // Warning: (ae-forgotten-export) The symbol "NotificationMessagePayload" needs to be exported by the entry point default-namespace.d.ts - export type NotificationMessagePayload = NotificationMessagePayload; // Warning: (ae-forgotten-export) The symbol "SendResponse" needs to be exported by the entry point default-namespace.d.ts export type SendResponse = SendResponse; // Warning: (ae-forgotten-export) The symbol "TokenMessage" needs to be exported by the entry point default-namespace.d.ts diff --git a/etc/firebase-admin.messaging.api.md b/etc/firebase-admin.messaging.api.md index b93ba7e58e..384e76d00e 100644 --- a/etc/firebase-admin.messaging.api.md +++ b/etc/firebase-admin.messaging.api.md @@ -157,12 +157,6 @@ export interface CriticalSound { volume?: number; } -// @public -export interface DataMessagePayload { - // (undocumented) - [key: string]: string; -} - // @public export interface FcmOptions { analyticsLabel?: string; @@ -300,25 +294,6 @@ export class MessagingClientErrorCode { }; } -// @public -export interface MessagingOptions { - // (undocumented) - [key: string]: any | undefined; - collapseKey?: string; - contentAvailable?: boolean; - dryRun?: boolean; - mutableContent?: boolean; - priority?: string; - restrictedPackageName?: string; - timeToLive?: number; -} - -// @public -export interface MessagingPayload { - data?: DataMessagePayload; - notification?: NotificationMessagePayload; -} - // @public export interface MessagingTopicManagementResponse { // Warning: (ae-forgotten-export) The symbol "FirebaseArrayIndexError" needs to be exported by the entry point index.d.ts @@ -340,24 +315,6 @@ export interface Notification { title?: string; } -// @public -export interface NotificationMessagePayload { - // (undocumented) - [key: string]: string | undefined; - badge?: string; - body?: string; - bodyLocArgs?: string; - bodyLocKey?: string; - clickAction?: string; - color?: string; - icon?: string; - sound?: string; - tag?: string; - title?: string; - titleLocArgs?: string; - titleLocKey?: string; -} - // @public export interface SendResponse { // Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts diff --git a/src/messaging/index.ts b/src/messaging/index.ts index 16054c2c38..fd0ce69640 100644 --- a/src/messaging/index.ts +++ b/src/messaging/index.ts @@ -53,12 +53,6 @@ export { WebpushConfig, WebpushFcmOptions, WebpushNotification, - - // Legacy APIs - DataMessagePayload, - MessagingOptions, - MessagingPayload, - NotificationMessagePayload, } from './messaging-api'; /** diff --git a/src/messaging/messaging-api.ts b/src/messaging/messaging-api.ts index 516c07bb44..de0f88dde5 100644 --- a/src/messaging/messaging-api.ts +++ b/src/messaging/messaging-api.ts @@ -666,309 +666,6 @@ export interface AndroidFcmOptions { analyticsLabel?: string; } -/** - * Interface representing an FCM legacy API data message payload. Data - * messages let developers send up to 4KB of custom key-value pairs. The - * keys and values must both be strings. Keys can be any custom string, - * except for the following reserved strings: - * - * - * - * See {@link https://firebase.google.com/docs/cloud-messaging/send-message | Build send requests} - * for code samples and detailed documentation. - */ -export interface DataMessagePayload { - [key: string]: string; -} - -/** - * Interface representing an FCM legacy API notification message payload. - * Notification messages let developers send up to 4KB of predefined - * key-value pairs. Accepted keys are outlined below. - * - * See {@link https://firebase.google.com/docs/cloud-messaging/send-message | Build send requests} - * for code samples and detailed documentation. - */ -export interface NotificationMessagePayload { - - /** - * Identifier used to replace existing notifications in the notification drawer. - * - * If not specified, each request creates a new notification. - * - * If specified and a notification with the same tag is already being shown, - * the new notification replaces the existing one in the notification drawer. - * - * **Platforms:** Android - */ - tag?: string; - - /** - * The notification's body text. - * - * **Platforms:** iOS, Android, Web - */ - body?: string; - - /** - * The notification's icon. - * - * **Android:** Sets the notification icon to `myicon` for drawable resource - * `myicon`. If you don't send this key in the request, FCM displays the - * launcher icon specified in your app manifest. - * - * **Web:** The URL to use for the notification's icon. - * - * **Platforms:** Android, Web - */ - icon?: string; - - /** - * The value of the badge on the home screen app icon. - * - * If not specified, the badge is not changed. - * - * If set to `0`, the badge is removed. - * - * **Platforms:** iOS - */ - badge?: string; - - /** - * The notification icon's color, expressed in `#rrggbb` format. - * - * **Platforms:** Android - */ - color?: string; - - /** - * The sound to be played when the device receives a notification. Supports - * "default" for the default notification sound of the device or the filename of a - * sound resource bundled in the app. - * Sound files must reside in `/res/raw/`. - * - * **Platforms:** Android - */ - sound?: string; - - /** - * The notification's title. - * - * **Platforms:** iOS, Android, Web - */ - title?: string; - - /** - * The key to the body string in the app's string resources to use to localize - * the body text to the user's current localization. - * - * **iOS:** Corresponds to `loc-key` in the APNs payload. See - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html | - * Payload Key Reference} and - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW9 | - * Localizing the Content of Your Remote Notifications} for more information. - * - * **Android:** See - * {@link http://developer.android.com/guide/topics/resources/string-resource.html | String Resources} - * for more information. - * - * **Platforms:** iOS, Android - */ - bodyLocKey?: string; - - /** - * Variable string values to be used in place of the format specifiers in - * `body_loc_key` to use to localize the body text to the user's current - * localization. - * - * The value should be a stringified JSON array. - * - * **iOS:** Corresponds to `loc-args` in the APNs payload. See - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html | - * Payload Key Reference} and - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW9 | - * Localizing the Content of Your Remote Notifications} for more information. - * - * **Android:** See - * {@link http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling | - * Formatting and Styling} for more information. - * - * **Platforms:** iOS, Android - */ - bodyLocArgs?: string; - - /** - * Action associated with a user click on the notification. If specified, an - * activity with a matching Intent Filter is launched when a user clicks on the - * notification. - * - * * **Platforms:** Android - */ - clickAction?: string; - - /** - * The key to the title string in the app's string resources to use to localize - * the title text to the user's current localization. - * - * **iOS:** Corresponds to `title-loc-key` in the APNs payload. See - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html | - * Payload Key Reference} and - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW9 | - * Localizing the Content of Your Remote Notifications} for more information. - * - * **Android:** See - * {@link http://developer.android.com/guide/topics/resources/string-resource.html | String Resources} - * for more information. - * - * **Platforms:** iOS, Android - */ - titleLocKey?: string; - - /** - * Variable string values to be used in place of the format specifiers in - * `title_loc_key` to use to localize the title text to the user's current - * localization. - * - * The value should be a stringified JSON array. - * - * **iOS:** Corresponds to `title-loc-args` in the APNs payload. See - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html | - * Payload Key Reference} and - * {@link https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW9 | - * Localizing the Content of Your Remote Notifications} for more information. - * - * **Android:** See - * {@link http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling | - * Formatting and Styling} for more information. - * - * **Platforms:** iOS, Android - */ - titleLocArgs?: string; - [key: string]: string | undefined; -} - -/** - * Interface representing a Firebase Cloud Messaging message payload. One or - * both of the `data` and `notification` keys are required. - * - * See {@link https://firebase.google.com/docs/cloud-messaging/send-message | Build send requests} - * for code samples and detailed documentation. - */ -export interface MessagingPayload { - - /** - * The data message payload. - */ - data?: DataMessagePayload; - - /** - * The notification message payload. - */ - notification?: NotificationMessagePayload; -} - -/** - * Interface representing the options that can be provided when sending a - * message via the FCM legacy APIs. - * - * See {@link https://firebase.google.com/docs/cloud-messaging/send-message | Build send requests} - * for code samples and detailed documentation. - */ -export interface MessagingOptions { - - /** - * Whether or not the message should actually be sent. When set to `true`, - * allows developers to test a request without actually sending a message. When - * set to `false`, the message will be sent. - * - * **Default value:** `false` - */ - dryRun?: boolean; - - /** - * The priority of the message. Valid values are `"normal"` and `"high".` On - * iOS, these correspond to APNs priorities `5` and `10`. - * - * By default, notification messages are sent with high priority, and data - * messages are sent with normal priority. Normal priority optimizes the client - * app's battery consumption and should be used unless immediate delivery is - * required. For messages with normal priority, the app may receive the message - * with unspecified delay. - * - * When a message is sent with high priority, it is sent immediately, and the - * app can wake a sleeping device and open a network connection to your server. - * - * For more information, see - * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message | - * Setting the priority of a message}. - * - * **Default value:** `"high"` for notification messages, `"normal"` for data - * messages - */ - priority?: string; - - /** - * How long (in seconds) the message should be kept in FCM storage if the device - * is offline. The maximum time to live supported is four weeks, and the default - * value is also four weeks. For more information, see - * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#ttl | Setting the lifespan of a message}. - * - * **Default value:** `2419200` (representing four weeks, in seconds) - */ - timeToLive?: number; - - /** - * String identifying a group of messages (for example, "Updates Available") - * that can be collapsed, so that only the last message gets sent when delivery - * can be resumed. This is used to avoid sending too many of the same messages - * when the device comes back online or becomes active. - * - * There is no guarantee of the order in which messages get sent. - * - * A maximum of four different collapse keys is allowed at any given time. This - * means FCM server can simultaneously store four different - * send-to-sync messages per client app. If you exceed this number, there is no - * guarantee which four collapse keys the FCM server will keep. - * - * **Default value:** None - */ - collapseKey?: string; - - /** - * On iOS, use this field to represent `mutable-content` in the APNs payload. - * When a notification is sent and this is set to `true`, the content of the - * notification can be modified before it is displayed, using a - * {@link https://developer.apple.com/reference/usernotifications/unnotificationserviceextension | - * Notification Service app extension}. - * - * On Android and Web, this parameter will be ignored. - * - * **Default value:** `false` - */ - mutableContent?: boolean; - - /** - * On iOS, use this field to represent `content-available` in the APNs payload. - * When a notification or data message is sent and this is set to `true`, an - * inactive client app is awoken. On Android, data messages wake the app by - * default. On Chrome, this flag is currently not supported. - * - * **Default value:** `false` - */ - contentAvailable?: boolean; - - /** - * The package name of the application which the registration tokens must match - * in order to receive the message. - * - * **Default value:** None - */ - restrictedPackageName?: string; - [key: string]: any | undefined; -} /** * Interface representing the server response from the diff --git a/src/messaging/messaging-namespace.ts b/src/messaging/messaging-namespace.ts index 43627c60ed..be74cb4e79 100644 --- a/src/messaging/messaging-namespace.ts +++ b/src/messaging/messaging-namespace.ts @@ -40,12 +40,6 @@ import { WebpushConfig as TWebpushConfig, WebpushFcmOptions as TWebpushFcmOptions, WebpushNotification as TWebpushNotification, - - // Legacy APIs - DataMessagePayload as TDataMessagePayload, - MessagingOptions as TMessagingOptions, - MessagingPayload as TMessagingPayload, - NotificationMessagePayload as TNotificationMessagePayload, } from './messaging-api'; /** @@ -198,26 +192,4 @@ export namespace messaging { * Type alias to {@link firebase-admin.messaging#WebpushNotification}. */ export type WebpushNotification = TWebpushNotification; - - // Legacy APIs - - /** - * Type alias to {@link firebase-admin.messaging#DataMessagePayload}. - */ - export type DataMessagePayload = TDataMessagePayload; - - /** - * Type alias to {@link firebase-admin.messaging#MessagingOptions}. - */ - export type MessagingOptions = TMessagingOptions; - - /** - * Type alias to {@link firebase-admin.messaging#MessagingPayload}. - */ - export type MessagingPayload = TMessagingPayload; - - /** - * Type alias to {@link firebase-admin.messaging#NotificationMessagePayload}. - */ - export type NotificationMessagePayload = TNotificationMessagePayload; }