Interface PushSubscription

This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. Available only in secure contexts.

MDN Reference

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

Properties

endpoint: string
expirationTime: null | number

Methods

  • Returns Promise<boolean>