new push()
Status: Experimental
Add the push object to the global navigator object
- Source:
Methods
-
<static> reconnect(options)
-
Reestablish the connection with the SimplePush server when closed or lost. This is an addition and not part of the SimplePush spec
Parameters:
Name Type Description options
Object an object used to initialize the connection to the SimplePush server Properties
Name Type Description simplePushServerURL
String the URL of the SimplePush server onConnect
Function a callback to fire when a connection is established with the SimplePush server. This is a deviation from the SimplePush spec as it is not necessary when you using the in browser functionality since the browser establishes the connection before the application is started. onClose
Function a callback to fire when a connection to the SimplePush server is closed or lost. Example
navigator.push.reconnect({ simplePushServerURL: "https://localhost:7777/simplepush", onConnect: myConnectCallback, onClose: myCloseCallback });
-
<static> register() → {Object}
-
Register a push notification channel with the SimplePush server
- Source:
Returns:
- The request object where a connection success callback can be registered- Type
- Object
Example
var mailRequest = navigator.push.register();
-
<static> unregister()
-
Unregister a push notification channel from the SimplePush server
Example
navigator.push.unregister( mailEndpoint );