Show:

Users.Device Class

Item Index

Methods

Methods

notificationGranted

(
  • callback
)
String | Bool static

Return whether device have notifications granted or no

Parameters:

Returns:

String | Bool:

return true if granted, false if blocked, "default" if didn't make choise yet

subscribe

(
  • callback
  • options
)
static

Subscribe to listen for push notifications if the current environment supports it. (Web Push, Cordova, etc.)

Parameters:

  • callback Function
  • options Object
    • userVisibleOnly Boolean

      whether the returned push subscription will only be used for messages whose effect is made visible to the user

    • applicationServerKey String

      A public key your push server will use to send messages to client apps via a push server. This value is part of a signing key pair generated by your application server, and usable with elliptic curve digital signature (ECDSA), over the P-256 curve.

subscribed

(
  • callback
)
static

Checks whether the user already has a subscription.

Parameters:

  • callback Boolean

    Whether the user already has a subscription

unsubscribe

(
  • callback
)
static

Unsubscribe to stop handling push notifications if we were previously subscribed

Parameters:

Events

onInit

Event occurs when the device adapter was initialized.

onNotification

Event occurs when a notification comes in to be processed by the app. The handlers you add are supposed to process it. The notification might have brought the app back from the background, or not. Please see the documentation here: https://github.com/katzer/cordova-plugin-local-notifications