Users.Device Class
Item Index
Methods
- notificationGranted static
- subscribe static
- subscribed static
- unsubscribe static
Events
Methods
notificationGranted
-
callback
Return whether device have notifications granted or no
Parameters:
-
callback
Function
Returns:
return true if granted, false if blocked, "default" if didn't make choise yet
subscribe
-
callback
-
options
Subscribe to listen for push notifications if the current environment supports it. (Web Push, Cordova, etc.)
Parameters:
-
callback
Function -
options
Object-
userVisibleOnly
Booleanwhether the returned push subscription will only be used for messages whose effect is made visible to the user
-
applicationServerKey
StringA 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
Checks whether the user already has a subscription.
Parameters:
-
callback
BooleanWhether the user already has a subscription
unsubscribe
-
callback
Unsubscribe to stop handling push notifications if we were previously subscribed
Parameters:
-
callback
Function
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