Example
// notify when the connectivity changes
siteKiosk.system.network.onConnectivityChanged(function(connected) {
console.log("Your connectivity changed, let's hope for the best...");
if(connected) {
console.log("Phew, internet is back.");
} else {
console.log("Terrific, internet is gone.");
}
});
Methods
-
<static> onConnectivityChanged(callback) → {siteKiosk.system.network~eventSubscription}
-
Fires when the network connectivity has been changed.
Parameters:
Name Type Description callback
siteKiosk.system.network~connectivityChangedCallback A callback being invoked when connectivity changes Returns:
A handler to unsubscribe the event
Type Definitions
-
connectivityChangedCallback(connected)
-
This callback is being invoked when network connectivity changes.
Parameters:
Name Type Description connected
boolean Whether the device is currently connected to the internet -
eventSubscription
-
An event subscription, used to unsubscribe the event.
Type:
- Object
Properties:
Name Type Description unbind
function A function to unsubscribe the event