Skip to main content

notification

The notification namespace handles in-app notification consent flows. It currently provides one method — requestNotificationAgreement — which displays a notification opt-in UI and delivers the user's response via a callback.

Methods

MethodReturn typePurpose
requestNotificationAgreement() => voidDisplay the notification opt-in UI and receive the user's response via callback. The return value is a cancel function.

Permission

No permission required — methods in the notification namespace are not bound to a PermissionName.

Agreement result types

The onEvent callback in requestNotificationAgreement delivers one of three result types.

typeMeaning
newAgreementThe user agreed to receive notifications for the first time.
alreadyAgreedThe user had already consented to this notification template.
agreementRejectedThe user declined to receive notifications.

Try it live

Run the methods interactively on the Notification page in sdk-example.

Open in sdk-example

External references