Navigate

API reference

pyric-admin/messaging

33 published symbols from pyric-admin

Generated from the TypeScript declarations shipped at this import path.

Check behavioral conformance

Classes

FirebaseMessagingError

Extends

  • PrefixedFirebaseError

Constructors

Constructor
new FirebaseMessagingError(info: ErrorCodeInfo, message?: string): FirebaseMessagingError;
Parameters
ParameterType
infoErrorCodeInfo
message?string
Returns

FirebaseMessagingError

Overrides
PrefixedFirebaseError.constructor

Properties

PropertyModifierType
codePrefixreadonlystring
errorInforeadonlyErrorInfo

Accessors

code
Get Signature
get code(): string;
Returns

string

Inherited from
PrefixedFirebaseError.code

Methods

hasCode()
hasCode(code: string): boolean;
Parameters
ParameterType
codestring
Returns

boolean

Inherited from
PrefixedFirebaseError.hasCode

toJSON()
toJSON(): ErrorInfo;
Returns

ErrorInfo

Inherited from
PrefixedFirebaseError.toJSON

Messaging

The sandbox Messaging service mirror, implementing the send plane over the broker.

Constructors

Constructor
new Messaging(app: SandboxAdminApp): Messaging;
Parameters
ParameterType
appSandboxAdminApp
Returns

Messaging

Accessors

app
Get Signature
get app(): SandboxAdminApp;

The app this Messaging instance is bound to (upstream get app(): App).

Returns

SandboxAdminApp

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
ParameterType
messageMessage
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
ParameterType
messagesMessage[]
dryRun?boolean
Returns

Promise<BatchResponse>

sendEachForMulticast()
sendEachForMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;

Fan a MulticastMessage (up to 500 tokens) out through sendEach.

Parameters
ParameterType
messageMulticastMessage
dryRun?boolean
Returns

Promise<BatchResponse>

subscribeToTopic()
subscribeToTopic(tokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;

Subscribe one or many registration tokens to a topic.

Parameters
ParameterType
tokenOrTokensstring | string[]
topicstring
Returns

Promise<MessagingTopicManagementResponse>

unsubscribeFromTopic()
unsubscribeFromTopic(tokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;

Unsubscribe one or many registration tokens from a topic.

Parameters
ParameterType
tokenOrTokensstring | string[]
topicstring
Returns

Promise<MessagingTopicManagementResponse>


MessagingClientErrorCode

Constructors

Constructor
new MessagingClientErrorCode(): MessagingClientErrorCode;
Returns

MessagingClientErrorCode

Properties

PropertyModifierType
AUTHENTICATION_ERRORreadonly{ code: string; message: string; }
AUTHENTICATION_ERROR.codepublicstring
AUTHENTICATION_ERROR.messagepublicstring
DEVICE_MESSAGE_RATE_EXCEEDEDreadonly{ code: string; message: string; }
DEVICE_MESSAGE_RATE_EXCEEDED.codepublicstring
DEVICE_MESSAGE_RATE_EXCEEDED.messagepublicstring
INTERNAL_ERRORreadonly{ code: string; message: string; }
INTERNAL_ERROR.codepublicstring
INTERNAL_ERROR.messagepublicstring
INVALID_ARGUMENTreadonly{ code: string; message: string; }
INVALID_ARGUMENT.codepublicstring
INVALID_ARGUMENT.messagepublicstring
INVALID_DATA_PAYLOAD_KEYreadonly{ code: string; message: string; }
INVALID_DATA_PAYLOAD_KEY.codepublicstring
INVALID_DATA_PAYLOAD_KEY.messagepublicstring
INVALID_OPTIONSreadonly{ code: string; message: string; }
INVALID_OPTIONS.codepublicstring
INVALID_OPTIONS.messagepublicstring
INVALID_PACKAGE_NAMEreadonly{ code: string; message: string; }
INVALID_PACKAGE_NAME.codepublicstring
INVALID_PACKAGE_NAME.messagepublicstring
INVALID_PAYLOADreadonly{ code: string; message: string; }
INVALID_PAYLOAD.codepublicstring
INVALID_PAYLOAD.messagepublicstring
INVALID_RECIPIENTreadonly{ code: string; message: string; }
INVALID_RECIPIENT.codepublicstring
INVALID_RECIPIENT.messagepublicstring
INVALID_REGISTRATION_TOKENreadonly{ code: string; message: string; }
INVALID_REGISTRATION_TOKEN.codepublicstring
INVALID_REGISTRATION_TOKEN.messagepublicstring
MESSAGE_RATE_EXCEEDEDreadonly{ code: string; message: string; }
MESSAGE_RATE_EXCEEDED.codepublicstring
MESSAGE_RATE_EXCEEDED.messagepublicstring
MISMATCHED_CREDENTIALreadonly{ code: string; message: string; }
MISMATCHED_CREDENTIAL.codepublicstring
MISMATCHED_CREDENTIAL.messagepublicstring
PAYLOAD_SIZE_LIMIT_EXCEEDEDreadonly{ code: string; message: string; }
PAYLOAD_SIZE_LIMIT_EXCEEDED.codepublicstring
PAYLOAD_SIZE_LIMIT_EXCEEDED.messagepublicstring
REGISTRATION_TOKEN_NOT_REGISTEREDreadonly{ code: string; message: string; }
REGISTRATION_TOKEN_NOT_REGISTERED.codepublicstring
REGISTRATION_TOKEN_NOT_REGISTERED.messagepublicstring
SERVER_UNAVAILABLEreadonly{ code: string; message: string; }
SERVER_UNAVAILABLE.codepublicstring
SERVER_UNAVAILABLE.messagepublicstring
THIRD_PARTY_AUTH_ERRORreadonly{ code: string; message: string; }
THIRD_PARTY_AUTH_ERROR.codepublicstring
THIRD_PARTY_AUTH_ERROR.messagepublicstring
TOO_MANY_TOPICSreadonly{ code: string; message: string; }
TOO_MANY_TOPICS.codepublicstring
TOO_MANY_TOPICS.messagepublicstring
TOPICS_MESSAGE_RATE_EXCEEDEDreadonly{ code: string; message: string; }
TOPICS_MESSAGE_RATE_EXCEEDED.codepublicstring
TOPICS_MESSAGE_RATE_EXCEEDED.messagepublicstring
UNKNOWN_ERRORreadonly{ code: string; message: string; }
UNKNOWN_ERROR.codepublicstring
UNKNOWN_ERROR.messagepublicstring

Interfaces

BaseMessage

Extends

  • Omit<BrokerMessage, "token" | "topic" | "condition">

Extended by

Properties

PropertyType
android?Record<string, unknown>
apns?Record<string, unknown>
data?Record<string, string>
fcmOptions?{ analyticsLabel?: string; }
fcmOptions.analyticsLabel?string
notification?{ body?: string; imageUrl?: string; title?: string; }
notification.body?string
notification.imageUrl?string
notification.title?string
webpush?{ data?: Record<string, string>; fcmOptions?: { link?: string; }; headers?: Record<string, string>; notification?: Record<string, unknown>; }
webpush.data?Record<string, string>
webpush.fcmOptions?{ link?: string; }
webpush.fcmOptions.link?string
webpush.headers?Record<string, string>
webpush.notification?Record<string, unknown>

BatchResponse

Properties

PropertyType
failureCountnumber
responsesSendResponse[]
successCountnumber

ConditionMessage

Extends

Properties

PropertyType
android?Record<string, unknown>
apns?Record<string, unknown>
conditionstring
data?Record<string, string>
fcmOptions?{ analyticsLabel?: string; }
fcmOptions.analyticsLabel?string
notification?{ body?: string; imageUrl?: string; title?: string; }
notification.body?string
notification.imageUrl?string
notification.title?string
webpush?{ data?: Record<string, string>; fcmOptions?: { link?: string; }; headers?: Record<string, string>; notification?: Record<string, unknown>; }
webpush.data?Record<string, string>
webpush.fcmOptions?{ link?: string; }
webpush.fcmOptions.link?string
webpush.headers?Record<string, string>
webpush.notification?Record<string, unknown>

MessagingTopicManagementResponse

Properties

PropertyType
errors{ error: FirebaseMessagingError; index: number; }[]
failureCountnumber
successCountnumber

MulticastMessage

Extends

Properties

PropertyType
android?Record<string, unknown>
apns?Record<string, unknown>
data?Record<string, string>
fcmOptions?{ analyticsLabel?: string; }
fcmOptions.analyticsLabel?string
notification?{ body?: string; imageUrl?: string; title?: string; }
notification.body?string
notification.imageUrl?string
notification.title?string
tokensstring[]
webpush?{ data?: Record<string, string>; fcmOptions?: { link?: string; }; headers?: Record<string, string>; notification?: Record<string, unknown>; }
webpush.data?Record<string, string>
webpush.fcmOptions?{ link?: string; }
webpush.fcmOptions.link?string
webpush.headers?Record<string, string>
webpush.notification?Record<string, unknown>

SendResponse

Properties

PropertyType
error?FirebaseMessagingError
messageId?string
successboolean

TokenMessage

Extends

Properties

PropertyType
android?Record<string, unknown>
apns?Record<string, unknown>
data?Record<string, string>
fcmOptions?{ analyticsLabel?: string; }
fcmOptions.analyticsLabel?string
notification?{ body?: string; imageUrl?: string; title?: string; }
notification.body?string
notification.imageUrl?string
notification.title?string
tokenstring
webpush?{ data?: Record<string, string>; fcmOptions?: { link?: string; }; headers?: Record<string, string>; notification?: Record<string, unknown>; }
webpush.data?Record<string, string>
webpush.fcmOptions?{ link?: string; }
webpush.fcmOptions.link?string
webpush.headers?Record<string, string>
webpush.notification?Record<string, unknown>

TopicMessage

Extends

Properties

PropertyType
android?Record<string, unknown>
apns?Record<string, unknown>
data?Record<string, string>
fcmOptions?{ analyticsLabel?: string; }
fcmOptions.analyticsLabel?string
notification?{ body?: string; imageUrl?: string; title?: string; }
notification.body?string
notification.imageUrl?string
notification.title?string
topicstring
webpush?{ data?: Record<string, string>; fcmOptions?: { link?: string; }; headers?: Record<string, string>; notification?: Record<string, unknown>; }
webpush.data?Record<string, string>
webpush.fcmOptions?{ link?: string; }
webpush.fcmOptions.link?string
webpush.headers?Record<string, string>
webpush.notification?Record<string, unknown>

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

ParameterType
app?SandboxAdminApp

Returns

Messaging


messaging()

function messaging(app?: SandboxAdminApp): Messaging;

Namespaced / legacy accessor — the admin.messaging(app?) equivalent of getMessaging.

Parameters

ParameterType
app?SandboxAdminApp

Returns

Messaging