Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PublicAPI

Hierarchy

  • PublicAPI

Index

Properties

getCustomUserID

getCustomUserID: function

Returns the user identifier associated to this installation

Type declaration

    • (): Promise<string | undefined>
    • Returns Promise<string | undefined>

getInstallationID

getInstallationID: function

Returns the installation identifier

Type declaration

    • (): Promise<string | undefined>
    • Returns Promise<string | undefined>

getNotificationPermission

getNotificationPermission: function

Returns the permission state of notifications. Having the permission to display notifications doens't mean that this installation is subscribed to push notifications.

  • granted : we have the permission
  • denied : we don't have the permission
  • default : we don't have, have to ask the user

Type declaration

    • (): Promise<NotificationPermission>
    • Returns Promise<NotificationPermission>

getSubscription

getSubscription: function

Returns the raw subscription associated to this insallation. Having a subscription doesn't necessarily mean the installation is subscribed, the user may have unsubscribed or refused notification. Call #isSubscribed() or #getSubscriptionState() to know the exact state of this subscription.

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getSubscriptionState

getSubscriptionState: function

Returns the subscription state including :

  • permission : determines the notification permission
  • subscribed : determines whether the user is subscribed and the permission is granted

Type declaration

getUserLanguage

getUserLanguage: function

Returns the user language associated to this installation

Type declaration

    • (): Promise<string | undefined>
    • Returns Promise<string | undefined>

getUserRegion

getUserRegion: function

Returns the user region associated to this installation

Type declaration

    • (): Promise<string | undefined>
    • Returns Promise<string | undefined>

isSubscribed

isSubscribed: function

Determines whether this installation is subscribed to push notifications and can receive notifications (browser notification permission granted, see #getNotificationPermission)

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

on

on: function

Listen to SDK events

Type declaration

    • (eventCode: SDKEvent, callback: any): void
    • Parameters

      • eventCode: SDKEvent
      • callback: any

      Returns void

runsOnOrigin

runsOnOrigin: function

Determines whether we're running on the same origin of the website

Type declaration

    • (): boolean
    • Returns boolean

setCustomUserID

setCustomUserID: function

Associate a user identifier to this installation.

Type declaration

    • (identifier: string | undefined): Promise<string | undefined>
    • Parameters

      • identifier: string | undefined

      Returns Promise<string | undefined>

setUserLanguage

setUserLanguage: function

Associate a user language override to this installation

Type declaration

    • (identifier: string | undefined): Promise<string | undefined>
    • Parameters

      • identifier: string | undefined

      Returns Promise<string | undefined>

setUserRegion

setUserRegion: function

Associate a user region override to this installation

Type declaration

    • (identifier: string | undefined): Promise<string | undefined>
    • Parameters

      • identifier: string | undefined

      Returns Promise<string | undefined>

subscribe

subscribe: function

Subscribe this installation to notification. Returns true if the installation is subscribed, false otherwise.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

tryToSubscribeFrom

tryToSubscribeFrom: function

Try to subscrive from the given subscription state. Force asking the permission even if the permission is granted

see

#getSubscriptionState to get the "state" parameter value

Type declaration

ui

ui: UiAPI

UI related methods

unsubscribe

unsubscribe: function

Unsubscribe this installation from notification. Returns true if the installation is unsubscribed, false otherwise.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

Generated using TypeDoc