sinch-rtc
    Preparing search index...

    Interface SinchClient

    SinchClient is an entry point for whole SDK

    interface SinchClient {
        callClient: CallClient;
        localUserId: string;
        pushNotificationDisplayName?: string;
        addListener(sinchClientListener: SinchClientListener): void;
        isStarted(): boolean;
        relayRemotePushNotification(
            payload: Record<string, string>,
        ): NotificationResult;
        removeListener(sinchClientListener: SinchClientListener): void;
        setSupportManagedPush(serviceWorker?: string): Promise<void>;
        start(): Promise<void>;
        terminate(): void;
    }
    Index

    Properties

    callClient: CallClient

    Returns the CallClient object for placing and receiving calls.

    the CallClient object.

    localUserId: string

    Returns the id of the user associated with this SinchClient.

    the local user id.

    pushNotificationDisplayName?: string

    Specify a display name to be used when the Sinch client initiates a call a on behalf of the local user (e.g. for an outgoing video call).

    Display name is included in a push notification on a best-effort basis. For example, if the target device has very limited push payload size constraints (e.g iOS 7 can only handle 255 byte push notification payload), then the display name may not be included. display name is also included in an incoming call, Call.remoteUserDisplayName

    display name

    Methods

    • Returns boolean

      true if the SinchClient is started.

    • Method used to forward the Sinch specific payload extracted from an incoming push notification. This will implicitly start the SinchClient if it wasn't already started.

      Parameters

      • payload: Record<string, string>

        Sinch specific payload which was transferred with the message

      Returns NotificationResult

      A result indicating initial inspection of the payload.

    • Enables the use of managed push, where Sinch is responsible for sending your app a push notification when necessary.

      Parameters

      • OptionalserviceWorker: string

        filename of push ServiceWorker definition, default is sw.js

      Returns Promise<void>

    • Starts the Sinch client. This must be done prior to making any calls.

      Returns Promise<void>

      InvalidOperationError if SinchClient is already started

    • Terminates the Sinch client, while still leaving it some time to finish up currently pending tasks, for example finishing pending HTTP requests.

      Returns void