Skip to content

NotificationConsent

Defined in: src/client/notification-consent.ts:158

Reads and withdraws an application’s consent, at the Internet Identity canister.

revoke(): Promise<void>

Defined in: src/client/notification-consent.ts:208

Withdraws this application’s consent to notify the signed-in user.

Idempotent at the canister: consent that is already withdrawn is Ok, because the caller wanted it gone and it is gone. What comes back as an error is the canister failing to write, and it is raised rather than dropped — an application that told a user it had turned notifications off should be able to find out that it had not.

Promise<void>


status(): Promise<NotificationConsentStatus>

Defined in: src/client/notification-consent.ts:191

Whether this application may notify the signed-in user.

A query, so the answer is uncertified: it is what a control is painted from, not something to rest a decision on.

Promise<NotificationConsentStatus>


static create(options): Promise<NotificationConsent>

Defined in: src/client/notification-consent.ts:172

Builds the calls as the session.

As the session and not as the application: Internet Identity authorises both methods by the principal the session signs with, which is the one that mints app delegations rather than any of the ones minted from it.

NotificationConsentOptions

Promise<NotificationConsent>