UNPKG

2.33 kBTypeScriptView Raw
1/*! firebase-admin v12.0.0 */
2/*!
3 * Copyright 2020 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17/**
18 * Firebase Cloud Messaging (FCM).
19 *
20 * @packageDocumentation
21 */
22import { App } from '../app';
23import { Messaging } from './messaging';
24export { Messaging, } from './messaging';
25export { AndroidConfig, AndroidFcmOptions, AndroidNotification, ApnsConfig, ApnsFcmOptions, ApnsPayload, Aps, ApsAlert, BaseMessage, BatchResponse, CriticalSound, ConditionMessage, FcmOptions, LightSettings, Message, MessagingTopicManagementResponse, MulticastMessage, Notification, SendResponse, TokenMessage, TopicMessage, WebpushConfig, WebpushFcmOptions, WebpushNotification, DataMessagePayload, MessagingConditionResponse, MessagingDeviceGroupResponse, MessagingDeviceResult, MessagingDevicesResponse, MessagingOptions, MessagingPayload, MessagingTopicResponse, NotificationMessagePayload, } from './messaging-api';
26/**
27 * Gets the {@link Messaging} service for the default app or a given app.
28 *
29 * `admin.messaging()` can be called with no arguments to access the default
30 * app's `Messaging` service or as `admin.messaging(app)` to access the
31 * `Messaging` service associated with aspecific app.
32 *
33 * @example
34 * ```javascript
35 * // Get the Messaging service for the default app
36 * const defaultMessaging = getMessaging();
37 * ```
38 *
39 * @example
40 * ```javascript
41 * // Get the Messaging service for a given app
42 * const otherMessaging = getMessaging(otherApp);
43 * ```
44 *
45 * @param app - Optional app whose `Messaging` service to
46 * return. If not provided, the default `Messaging` service will be returned.
47 *
48 * @returns The default `Messaging` service if no
49 * app is provided or the `Messaging` service associated with the provided
50 * app.
51 */
52export declare function getMessaging(app?: App): Messaging;