@nextcloud/dialogs
    Preparing search index...

    Interface PushSubscription

    The PushSubscription interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. Available only in secure contexts.

    MDN Reference

    interface PushSubscription {
        endpoint: string;
        expirationTime: number | null;
        options: PushSubscriptionOptions;
        getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
        toJSON(): PushSubscriptionJSON;
        unsubscribe(): Promise<boolean>;
    }
    Index
    endpoint: string

    The endpoint read-only property of the the endpoint associated with the push subscription.

    MDN Reference

    expirationTime: number | null

    The expirationTime read-only property of the of the subscription expiration time associated with the push subscription, if there is one, or null otherwise.

    MDN Reference

    The options read-only property of the PushSubscription interface is an object containing the options used to create the subscription.

    MDN Reference

    • The getKey() method of the PushSubscription interface returns an ArrayBuffer representing a client public key, which can then be sent to a server and used in encrypting push message data.

      MDN Reference

      Parameters

      Returns ArrayBuffer | null

    • The toJSON() method of the PushSubscription interface is a standard serializer: it returns a JSON representation of the subscription properties, providing a useful shortcut.

      MDN Reference

      Returns PushSubscriptionJSON

    • The unsubscribe() method of the PushSubscription interface returns a Promise that resolves to a boolean value when the current subscription is successfully unsubscribed.

      MDN Reference

      Returns Promise<boolean>