<abstract> new Platform()
Base class for platform-specific capabilities.
Base class for platform-specific capabilities. Users may derive from this class to
provide implementations specific to their platform.
- Source:
Methods
-
cacheCredentials(username, password)
Implementors can override this function to cache user credentials for offline login.
-
Implementors can override this function to cache user credentials for offline login. The default implementation is a no-op.
Parameters:
Name Type Description username
String The user name. password
String The password. - Source:
-
getDeviceId()
Returns a device ID used by Diagnostics.
-
Returns a device ID used by Diagnostics.
- Source:
Returns:
The device ID.- Type
- String
-
getDeviceInformation()
Returns an object with device information used by Analytics.
-
Returns an object with device information used by Analytics
- Source:
Returns:
The device specific information. -
getGPSLocation()
Returns an object that has the current GPS location of the device or null.
-
Returns an object that has the current GPS location of the device or null.
- Source:
Returns:
The GPS location is available.- Type
- Platform~GPSLocation
-
<abstract> invokeService(request)
Performs an HTTP request.
-
Performs an HTTP request.
Parameters:
Name Type Description request
Object The format of the request parameter is identical to the settings parameter in JQuery's ajax method. However, only the method, url, headers ,data, success and error properties are used. - Source:
-
setDeviceState(state)
Sets the current state of the device.
-
Sets the current state of the device. Platform implementations should call this function when the state changes. The state is inspected before background operations like synchronization are performed.
Parameters:
Name Type Description state
mcs.deviceState The new state of the device. - Source:
-
validateCachedCredentials(username, password)
Implementors can override this function to allow offline login.
-
Implementors can override this function to allow offline login. [cacheCredentials()]{Platform#cacheCredentials} Should also be overridden to cache the credentials. The default implementation returns false.
Parameters:
Name Type Description username
String The user name. password
String The password. - Source:
Returns:
True if the username and password are valid, false otherwise.- Type
- Boolean
Type Definitions
-
DeviceInformation
Class that provides information about the device.
-
Class that provides information about the device.
Type:
- Object
- Source:
Properties:
Name Type Description model
String The device's model. manufacturer
String The device's manufacturer. osName
String The operating system. osVersion
String The operating system's version. osBuild
String The operating system's build number. carrier
String The device's wireless carrier. -
GPSLocation
Class that provides the current GPS location of the device.
-
Class that provides the current GPS location of the device.
Type:
- Object
- Source:
Properties:
Name Type Description latitude
String The device's current latitude. longitude
String The device's current longitude.