Classes
FirebaseMessagingError
Extends
Error
Constructors
Constructor
new FirebaseMessagingError(info: ErrorCodeInfo, message?: string): FirebaseMessagingError;
Parameters
| Parameter | Type |
|---|---|
info | ErrorCodeInfo |
message? | string |
Returns
Overrides
Error.constructor
Properties
Messaging
The sandbox Messaging service mirror, implementing the send plane over
the broker.
Constructors
Constructor
new Messaging(app: SandboxAdminApp): Messaging;
Parameters
| Parameter | Type |
|---|---|
app | SandboxAdminApp |
Returns
Accessors
app
Get Signature
get app(): SandboxAdminApp;
The app this Messaging instance is bound to (upstream get app(): App).
Returns
Methods
enableLegacyHttpTransport()
enableLegacyHttpTransport(): void;
Force HTTP/1.1 for batch sends — deprecated upstream; the sandbox has no HTTP transport, so this is a recorded no-op.
Returns
void
send()
send(message: Message, dryRun?: boolean): Promise<string>;
Send one message. Resolves the FCM resource name
projects/<projectId>/messages/<id> — numeric id for topic/condition
targets, UUID-form for token targets. dryRun validates on the
identical path and returns the SAME shape with a fake id (captured
dryRunSameShapeAsReal / realSendEnvelopeIdentical parity).
Parameters
| Parameter | Type |
|---|---|
message | Message |
dryRun? | boolean |
Returns
Promise<string>
sendEach()
sendEach(messages: Message[], dryRun?: boolean): Promise<BatchResponse>;
Send up to 500 messages; the resolved BatchResponse.responses array is
ordered to match the input, one entry per message.
Parameters
| Parameter | Type |
|---|---|
messages | Message[] |
dryRun? | boolean |
Returns
Promise<BatchResponse>
sendEachForMulticast()
sendEachForMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
Fan a MulticastMessage (up to 500 tokens) out through sendEach.
Parameters
| Parameter | Type |
|---|---|
message | MulticastMessage |
dryRun? | boolean |
Returns
Promise<BatchResponse>
subscribeToTopic()
subscribeToTopic(tokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
Subscribe one or many registration tokens to a topic.
Parameters
| Parameter | Type |
|---|---|
tokenOrTokens | string | string[] |
topic | string |
Returns
Promise<MessagingTopicManagementResponse>
unsubscribeFromTopic()
unsubscribeFromTopic(tokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
Unsubscribe one or many registration tokens from a topic.
Parameters
| Parameter | Type |
|---|---|
tokenOrTokens | string | string[] |
topic | string |
Returns
Promise<MessagingTopicManagementResponse>
MessagingClientErrorCode
Constructors
Constructor
new MessagingClientErrorCode(): MessagingClientErrorCode;
Returns
Properties
Interfaces
BaseMessage
Extends
Omit<BrokerMessage,"token"|"topic"|"condition">
Extended by
Properties
BatchResponse
Properties
| Property | Type |
|---|---|
failureCount | number |
responses | SendResponse[] |
successCount | number |
ConditionMessage
Extends
Properties
MessagingTopicManagementResponse
Properties
| Property | Type |
|---|---|
errors | { error: FirebaseMessagingError; index: number; }[] |
failureCount | number |
successCount | number |
MulticastMessage
Extends
Properties
SendResponse
Properties
| Property | Type |
|---|---|
error? | FirebaseMessagingError |
messageId? | string |
success | boolean |
TokenMessage
Extends
Properties
TopicMessage
Extends
Properties
Type Aliases
AndroidConfig
type AndroidConfig = Record<string, unknown>;
AndroidFcmOptions
type AndroidFcmOptions = Record<string, unknown>;
AndroidNotification
type AndroidNotification = Record<string, unknown>;
ApnsConfig
type ApnsConfig = Record<string, unknown>;
ApnsFcmOptions
type ApnsFcmOptions = Record<string, unknown>;
ApnsPayload
type ApnsPayload = Record<string, unknown>;
Aps
type Aps = Record<string, unknown>;
ApsAlert
type ApsAlert = string | Record<string, unknown>;
CriticalSound
type CriticalSound = Record<string, unknown>;
DataMessagePayload
type DataMessagePayload = Record<string, string>;
FcmOptions
type FcmOptions = NonNullable<BrokerMessage["fcmOptions"]>;
LightSettings
type LightSettings = Record<string, unknown>;
Message
type Message =
| TokenMessage
| TopicMessage
| ConditionMessage;
MessagingOptions
type MessagingOptions = Record<string, unknown>;
MessagingPayload
type MessagingPayload = Record<string, unknown>;
Notification
type Notification = NonNullable<BrokerMessage["notification"]>;
Mirror-owned structural messaging types.
NotificationMessagePayload
type NotificationMessagePayload = Record<string, string>;
WebpushConfig
type WebpushConfig = NonNullable<BrokerMessage["webpush"]>;
WebpushFcmOptions
type WebpushFcmOptions = NonNullable<WebpushConfig["fcmOptions"]>;
WebpushNotification
type WebpushNotification = Record<string, unknown>;
Functions
getMessaging()
function getMessaging(app?: SandboxAdminApp): Messaging;
Return the broker-backed Messaging service for the default or given
sandbox admin app.
Parameters
| Parameter | Type |
|---|---|
app? | SandboxAdminApp |
Returns
messaging()
function messaging(app?: SandboxAdminApp): Messaging;
Namespaced / legacy accessor — the admin.messaging(app?) equivalent of
getMessaging.
Parameters
| Parameter | Type |
|---|---|
app? | SandboxAdminApp |