supported cordova plugin - Samsung/cordova-plugin-toast GitHub Wiki
Supported platforms
- browser
- sectv-orsay (sectv-orsay)
- sectv-tizen (sectv-tizen)
- tv-webos (tv-webos)
Supported cordova plugins
There are 3 cordova plugins which are supported on TOAST
- cordova-plugin-device
- cordova-plugin-globalization
- cordova-plugin-network-information
cordova-plugin-device
Please note that device plugin is based on cordova spec. If you want get more details for usage, refer cordova-plugin-device
device
This plugin defines a global device
object, which describes the device's hardware and software. Although the object is in the global scope, it is not available until after the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(JSON.stringify(device));
}
Properties
- device.cordova
- Cordova version
- device.platform
- 'sectv-tizen', 'sectv-orsay', 'tv-webos'
- device.model
- Device modelCode
- device.version
- Firmware version
- device.uuid
- device unique id
- device.manufacturer
- 'Samsung Tizen TV', 'Samsung Orsay TV', 'LG Webos TV'
cordova-plugin-globalization
Please note that globalization plugin is based on cordova spec. If you want get more details for usage, refer cordova-plugin-globalization
navigator.globalization
navigator.globalization.getPreferredLanguage(successCallback, errorCallback);
This function retrieves language.
-
Parameters
- successCallback: The method to call when a list of supported keys are retrieved successfully.
- errorCallback: The method to invoke when an error occurs.
-
Return value N/A
-
Examples
navigator.globalization.getPreferredLanguage(function (language) { console.log('language : ' + language.value); }, function (e) { console.log('Error getting language : ' + e.message);} );
navigator.globalization.getLocaleName(successCallback, errorCallback);
This function retrieves locale name.
-
Parameters
- successCallback: The method to call when a list of supported keys are retrieved successfully.
- errorCallback: The method to invoke when an error occurs.
-
Return value N/A
-
Examples
navigator.globalization.getLocaleName(function (locale) { console.log('locale: ' + locale.value); }, function (e) { console.log('Error getting locale : ' + e.message);} );
cordova-plugin-network-information
Please note that network-information plugin is based on cordova spec. If you want get more details for usage, refer cordova-plugin-network-information
navigator.connection
Properties
- connection.type
Constants
- Connection.UNKNOWN
- Connection.ETHERNET
- Connection.WIFI
- Connection.CELL_2G
- Connection.CELL_3G
- Connection.CELL_4G
- Connection.CELL
- Connection.NONE
document.addEventListener("online", yourCallbackFunction, false);
This event fires when an application goes online, and the device becomes connected to the Internet.
-
Examples
document.addEventListener("online", onOnline, false); function onOnline() { // Handle the online event var networkState = navigator.connection.type; if (networkState !== Connection.NONE) { // TODO } console.log('Connection type: ' + networkState); }
document.addEventListener("offline", yourCallbackFunction, false);
The event fires when an application goes offline, and the device is not connected to the Internet.
-
Examples
document.addEventListener("offline", onOffline, false); function onOffline() { // Handle the offline event }
See others
None