Skip to content

ws1-client-sdk/com.airwatch.sdk/SDKManager

SDKManager

class SDKManager

Wrapper class to wrap the communication with the WS1 Anchor Application (Agent or Container).

SDK controls access to methods based upton type of application. Apps without permission trying to access methods will throw AirWatchSDKException Methods have multiple access control Levels as in below:

  • NONE: no restrictions applied
  • AW_ONLY: apps signed by WS1 only allowed
  • AW_WHITELISTED: apps with signatures white listed by WS1
  • AW_MANAGED: apps downloaded and installed by WS1 Anchor Application (Agent or Container) AKA managed apps

SDK Initialization should be done before accessing information from anchor application. Below is sample usage of this class, showing initialization and fetching custom settings.

Note: Initialization should be done in a background thread.

try {
  SDKManager sdkManager = SDKManager.init(context);
  String customSettings = sdkManager.getCustomSettings();
} catch (Exception e) {
     e.printStackTrace();
}

See also

Functions

Name Summary
acceptCheckoutEULA open fun acceptCheckoutEULA(eulaContentId: String, accepted: Boolean): CheckoutResponse
Request console to check out the device for corresponding user with Accept EULA acknowledgment.
authenticateUser open fun authenticateUser(userName: String, userPassword: String): Boolean
Verifies authentication credentials with the console.
autoEnroll open fun autoEnroll(server: String, groupId: String, user: String, password: String): Boolean
Enrolls the application silently if agent is not yet enrolled.
autoUnenroll open fun autoUnenroll(): Boolean
UnEnrolls the application silently if agent is enrolled.
checkInDevice open fun checkInDevice(): Int
Used to checkin the device.
checkOutDevice open fun checkOutDevice(user: String, password: String, groupCode: String): CheckoutResponse
Checkouts the device from (login to) a different child organization group than the one it is enrolled to.
deinit open fun deinit(): Boolean
DeInitializes the WS1 SDK.
deleteCustomAttributes open fun deleteCustomAttributes(attributes: List<CustomAttributeData>): Int
Deletes custom attributes for the given list of attributes.
getAPIVersion open fun getAPIVersion(): Int
Retrieves the revision level of the WS1 SDK.
getApplicationConfiguration open fun getApplicationConfiguration(): Bundle
Fetches key-value pair configuration set for the application in the console.
getApplicationProfile open fun getApplicationProfile(): ApplicationProfile
This method is used to get the Application Profile as defined at the WS1 UEM Console.
getAuthenticationType open fun getAuthenticationType(): Int
Get the Authentication Type set in WS1 UEM Console.
getBindingPackageName open fun getBindingPackageName(context: Context): String
Utility method to determine the Anchor App to which SDK will be bound.
getConsoleVersion open fun getConsoleVersion(): Float
Provides console version to which device is connected.
getCustomSettings open fun getCustomSettings(): String
Fetches the Custom Settings that are defined for the anchor app i.e., Agent or Workspace.
getDeviceLastCheckinTime open fun getDeviceLastCheckinTime(): Long
Get the timestamp (in milliseconds) when the last Beacon was successfully sent.
getDeviceSerialId open fun getDeviceSerialId(): String
Returns the device SERIAL ID.
getEnrollmentUsername open fun getEnrollmentUsername(): String
Retrieves Enrollment Username assigned to the App which the device is currently enrolled.
getGroupId open fun getGroupId(): String
Retrieves the location group in which the device is currently enrolled.
getPasscodePolicy open fun getPasscodePolicy(): PasscodePolicy
Get the Passcode Policy that is defined on the WS1 UEM Console.
getRestrictionPolicy open fun getRestrictionPolicy(): RestrictionPolicy
Fetches the Restriction Policy as defined at the WS1 UEM Console.
getSDKProfile open fun getSDKProfile(): IBaseConfiguration
Returns the SDK profile manager for the current application.
getSDKProfileJSONString open fun getSDKProfileJSONString(): String
Returns the SDK profile as a JSON string from the Anchor app.
getServerName open fun getServerName(): String
Retrieves the server name in which the device is currently enrolled.
getServerPort open fun getServerPort(): Int
Retrieves the port number in which the device is currently enrolled.
getSharedDeviceStatus open fun getSharedDeviceStatus(): SharedDeviceStatus
Fetches the SharedDevice status of the current device Access Level = AW_MANAGED (for details on access permission please check SDKManager)
getSSOStatus open fun getSSOStatus(): SsoSessionReturnCode
Provides the status of the broker app even before SDKManager instance is initialized.
init open fun init(context: Context): SDKManager
Initializes the WS1 SDK.
isCompliant open fun isCompliant(): Boolean
Determines if the device is currently in good standings with the compliance rules.
isCompromised open fun isCompromised(): Boolean
Determines if the device is rooted as diagnosed by WS1 MDM Agent.
isEnrolled open fun isEnrolled(): Boolean
Determines if the device is currently enrolled in AirWatch.
isServiceConnected open fun isServiceConnected(): Boolean
Provides binding status of current app with Anchor app
isSSOEnabled open fun isSSOEnabled(): Boolean
Determines if the Single Sign On feature is enabled for the 3rd party application.
isSSOSessionValid open fun isSSOSessionValid(): Boolean
Provides if SSO session valid.
performSharedDeviceOperation open fun performSharedDeviceOperation(bundle: Bundle, resultReceiver: ResultReceiver)
Performs shared device operations such as checkout,checkin etc.
readCustomAttributes open fun readCustomAttributes(queries: List<CustomAttributeData>): List<CustomAttributeData>
Reads custom attributes for the given list of queries.
refreshBinding open fun refreshBinding(context: Context): SDKManager
Refreshes the binding of WS1 SDK, when Workspace is installed/removed.
requestCertificates open fun requestCertificates(issuerId: String, token: String, iCrc: ICertificateReceiverCallback): Boolean
Requests the Anchor application to send the Certificates corresponding to the requested issuerId.
uploadApplicationLogs open fun uploadApplicationLogs(): Boolean
This method is used to upload the application logs to the anchor app.
writeCustomAttributes open fun writeCustomAttributes(attributes: List<CustomAttributeData>): Int
Writes custom attributes for the given list of attributes.