1. API
  2. pushNotifications

API

Methods for configuring and managing push notifications from Firebase Cloud Messaging in a ToDesktop application.

Remarks

This package exposes a number of methods for configuring and managing push notifications from Firebase Cloud Messaging.

Functions

Function Description
start(id, options) Starts the push notification service.

start()

Starts the push notification service.

Signature:

        import { pushNotifications } from "@todesktop/client-core"
pushNotifications.start(id: string, options?: PushNotificationStartOptions): Promise<void>;

      
Parameters
Parameter Type Description
id string Firebase Sender ID
options PushNotificationStartOptions

Returns:

Promise<void>

Variables

Variable Description
on

on

Signature:

        on: (event: "*" | PushNotificationsEvent, callback: (...any: any[]) => void) => Promise<() => Promise<void>>

      

Type Aliases

PushNotificationsEvent

Signature:

        export declare type PushNotificationsEvent = "start" | "error" | "tokenUpdate" | "receive";

      

PushNotificationStartOptions

Signature:

        export declare type PushNotificationStartOptions = {
    showNotifications?: boolean;
};