Pyric
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

  • Error

Constructors

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

FirebaseMessagingError

Overrides
Error.constructor

Properties

PropertyModifierType
codereadonlystring

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
INVALID_ARGUMENTreadonly{ code: string; message: string; }
INVALID_ARGUMENT.codepublicstring
INVALID_ARGUMENT.messagepublicstring
INVALID_REGISTRATION_TOKENreadonly{ code: string; message: string; }
INVALID_REGISTRATION_TOKEN.codepublicstring
INVALID_REGISTRATION_TOKEN.messagepublicstring
REGISTRATION_TOKEN_NOT_REGISTEREDreadonly{ code: string; message: string; }
REGISTRATION_TOKEN_NOT_REGISTERED.codepublicstring
REGISTRATION_TOKEN_NOT_REGISTERED.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