Install the SDK in an environment without a previous version of the SDK.

For details on how to expose a custom scheme for the call back scheme using the AirWatch Agent for iOS, AirWatch Container, or Workspace ONE, see Expose a Custom Scheme To Use in a Callback Scheme.

  1. Unzip the AirWatchSDK DMG file.
  2. Drag and drop the current AirWatchSDK framework file and the attached AWCMWrapper file into your Embedded Binaries, which is on the General tab of your project settings.

    Do not add the framework files to only the Link Binary with Libraries because this actions causes the application to crash. When you add it to the Embedded Binaries, this action automatically adds the file to the Link Binary with Libraries, too.

  3. Register your callback scheme.
  4. Import the AWSDK module.

  5. Make your AppDelegate conform to the AWControllerDelegate protocol.

    import AWSDK 
                            
                            class AppDelegate: UIResponder, UIApplicationDelegate, AWControllerDelegate { 
                            
                            
                            
                         
  6. In the AppDelegate, add the following code to initialize and start the SDK.

    Do not call the start method in applicationWillEnterForeground or applicationDidBecomeActive. These start methods result in inconsistent UI behavior.

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:
                            [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
                            
                            let awcontroller = AWController.clientInstance() awcontroller.callbackScheme = "myCallbackScheme"
                            
                            
                            awcontroller.delegate = self
                            
                            awcontroller.start()
                            return true 
                            
                            } 
                            
                            
                            
                         
  7. In the AppDelegate, implement the listed method and code to enable the SDK to receive and handle communication from other Workspace ONE UEM applications.

    func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey
                            : Any] = [:]) -> Bool { 
                            
                            // `AWController.handleOpenURL` method will reconnect the SDK back to its previous
                            state to continue.
                            // If you are handling application specific URL schemes. Please make sure that the
                            URL is not intended for SDK Controller.
                            // An example way to perform this.
                            
                            let sourceApplication: String? = options[UIApplicationOpenURLOptionsKey.sourceApplication]
                            
                            let handedBySDKController = AWController.clientInstance().handleOpenURL(url, 
                            
                            fromApplication: sourceApplication) if handedBySDKController { 
                            	
                            	AWLogInfo("Handed over open URL to AWController")
                            	// SDK Controller will continue with the result from Open URL. 
                            	
                            	return true 
                            
                            } 
                            
                            // Handle if this URL is for the Application. 
                            	
                            	return false 
                            
                            }
                            
                            
                            
                         
  8. Implement the required delegate method controllerDidFinishInitialCheck.

    	func controllerDidFinishInitialCheck(error: NSError?) {
                            	if error != nil {
                            AWLogError("Initial Check Done Error: \(error)")
                            return
                            }
                            AWLogInfo("SDK Initial Check Done!")
                            	}
                            
                            
                            
                         

You can add optional delegate methods that are described in Required and Optional AWController Delegate Callback Methods.