* Indicates whether this subscription exceeded the background message quota, * or the user revoked the notification permission. The caller must request a * new subscription to continue receiving push messages. */ isExpired() { return this.quota === 0; } /** * Returns a key for encrypting messages sent to this subscription. JS * callers receive the key buffer as a return value, while C++ callers * receive the key size and buffer as out parameters. */ getKey(name) { switch (name) { case "p256dh": return this.#getRawKey(this.#props.p256dhKey); case "auth": return this.#getRawKey(this.#props.authenticationSecret); case "appServer": return this.#getRawKey(this.#props.appServerKey); } return []; } #getRawKey(key) { if (!key) { return []; } return new Uint8Array(key); } } PK