<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 usernameString The user name. passwordString 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 requestObject 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 statemcs.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 usernameString The user name. passwordString 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 modelString The device's model. manufacturerString The device's manufacturer. osNameString The operating system. osVersionString The operating system's version. osBuildString The operating system's build number. carrierString 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 latitudeString The device's current latitude. longitudeString The device's current longitude.