Vmware Workspace ONE SDK for Ios (Swift)
Total Page:16
File Type:pdf, Size:1020Kb
VMware Workspace ONE SDK for iOS (Swift) VMware Workspace ONE UEM VMware Workspace ONE SDK for iOS (Swift) You can find the most up-to-date technical documentation on the VMware website at: https://docs.vmware.com/ If you have comments about this documentation, submit your feedback to [email protected] VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com Copyright © 2018 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc. 2 Contents 1 Workspace ONE iOS SDK (Swift) 5 2 VMware Workspace ONE SDK Installation 6 Migrate the VMware Workspace ONE SDK for iOS (Objective-C) Version to the Swift Version 6 Component Changes in the VMware Workspace ONE SDK for iOS (Swift) 7 Install the VMware Workspace ONE SDK for iOS (Swift) in a New Environment 10 Expose a Custom Scheme To Use in a Callback Scheme 11 3 VMware Workspace ONE SDK for iOS (Swift) Setup 13 Initialize the VMware Workspace ONE SDK for iOS (Swift) 14 Required and Optional AWController Delegate Callback Methods 15 Keychain Access Group Entitlements 16 Enable Keychain Sharing for VMware Workspace ONE SDK Applications 17 Troubleshoot Keychain Enablement 18 Cluster Session Management and Reduced Flip Behavior for SSO in the Workspace ONE SDK for iOS (Swift) 19 Entries to Set in the AWSDKDefaultSettings.plist 19 Test the Integration and Functions of Applications 20 4 VMware Workspace ONE SDK Capabilities 22 VMware Workspace ONE SDK Capabilities Quick Reference, Code and Console 24 Enable SDK Feature Flags 26 Authentication Type Function Description 27 Authentication Type and SSO Setting Behaviors 27 Authentication and Changes to Active Directory Passwords 27 SSO Configurations and System Login Behavior for iOS Applications 28 Integrated Authentication and the Challenge Handler 30 Requirements for Integrated Authentication 31 SCEP Support to Retrieve Certificates for Integrated Authentication 32 VMware Workspace ONE SDK for iOS (Swift) Methods for a Pending Status from the SCEP Certificate Authority 32 VMware Tunnel for App Tunneling by Proxy Components 34 App Tunneling Known Limitations and Other Considerations 34 Use DLP to Control the Copy and Paste of Data Out and Into Your SDK-Built Application 35 Behavior of the Third-Party Keyboard Restriction in the VMware Workspace ONE SDK 36 Use DLP to Control Links to Open in VMware Browser and VMware Boxer 37 Set Up the DataSampler Module for Analytics 39 VMware, Inc. 3 VMware Workspace ONE SDK for iOS (Swift) Use the VMware Workspace ONE SDK for iOS (Swift) Branding Payload to Add Logos and Primary Highlight Colors 40 Beacon Data Sent Upon Application Unlock or Sent Manually 42 Certificate Pinning 44 Check the Compromised Status of Devices with Compromised Protection 44 Query Devices for MDM Information with DeviceInformationController 45 Geofence Capabilities 45 Logging Capabilities 45 Offline Access 46 Custom Settings for the SDK 47 Encrypt Data on Devices 47 5 VMware Workspace ONE SDK for iOS (Swift) and the Apple App Review 49 Steps to Configure App Review Mode 50 Configure an App Review Mode Testing Environment in the Workspace ONE UEM Console 50 Declare the App Review Server and Group ID in the SDK PLIST 52 Test the App Review Mode Testing Environment in the Workspace ONE UEM Console 52 Build Script Information for App Store Submission 53 VMware, Inc. 4 Workspace ONE iOS SDK (Swift) 1 ® The VMware Workspace ONE SDK is a set of tools allowing organizations to incorporate a host of features and functionality into their custom-built iOS applications. The Workspace ONE SDK enhances the security and functionality of those applications and in turn helps save application development time and money. Version of Workspace ONE SDK for iOS (Swift) and Workspace ONE UEM Console n Workspace ONE SDK for iOS (Swift) v18.10 n Workspace ONE UEM console v9.1.1+ Supported iOS Components n Apple iOS - 9.0+ n Xcode - 9.4, 9.4.1, and 10.0 n Supported Swift Versions - All Swift versions shipped with the listed Xcode versions Corresponding Objective-C Interfaces The examples in this document are in Swift. See the AWController Interface file for corresponding Objective-C Interfaces if you import the Workspace ONE SDK for iOS (Swift) into an Objective-C application. Objective-C Features Not Supported in the Swift Version The Workspace ONE SDK for iOS (Objective-C) supports the detection of a user change on shared devices. The Workspace ONE SDK for iOS (Swift) does not support this feature. VMware, Inc. 5 VMware Workspace ONE SDK Installation 2 Install the Workspace ONE SDK for iOS (Swift) by migrating an installation or by installing a new version. Migrate the SDK from an Earlier Version to the Latest Version To migrate to a Swift version of the Workspace ONE SDK, remove the Objective-C version. Then, add the Swift version to your environment. See Migrate the VMware Workspace ONE SDK for iOS (Objective-C) Version to the Swift Version. To see what components changed from the earlier version of the SDK to this version that supports Swift, see Component Changes in the VMware Workspace ONE SDK for iOS (Swift). Install the SDK in a New Environment For information on installing the SDK in an environment without a previous version of the SDK, see Install the VMware Workspace ONE SDK for iOS (Swift) in a New Environment. Part of the installation process in a new environment is to expose a custom scheme. See Expose a Custom Scheme To Use in a Callback Scheme for information. This chapter includes the following topics: n Migrate the VMware Workspace ONE SDK for iOS (Objective-C) Version to the Swift Version n Install the VMware Workspace ONE SDK for iOS (Swift) in a New Environment Migrate the VMware Workspace ONE SDK for iOS (Objective-C) Version to the Swift Version To migrate to a version of the Workspace ONE SDK for iOS (Swift)Workspace ONE SDK for iOS (Swift), remove the old SDK and add the current one to your environment. See Component Changes in the VMware Workspace ONE SDK for iOS (Swift) for changes to make to your project to prevent build errors. VMware, Inc. 6 VMware Workspace ONE SDK for iOS (Swift) Remove the Objective-C Version of the SDK Delete the listed Workspace ONE SDK for iOS (Swift)frameworks and libraries to remove the SDK. 1 On the General tab in your project, delete the AWSDK.framework from both the Embedded Binaries and Link Framework and Libraries areas. 2 Open the Build Phases tab in the project settings of your application. 3 Delete AWKit from your project. 4 Delete AWlocalization from your project. Add the Swift Version of the SDK Add Workspace ONE SDK for iOS (Swift) frameworks and edit the locations of the listed calls to migrate SDK behaviors to the current version. If you do not edit the listed call locations, the UI behavior is inconsistent with the previous SDK version. 1 Drag and drop the current AirWatchSDK framework and the AWCMWrapper file into your Link Binary with Libraries step in the build phase section of your project settings. 2 Change the location of your StartSDK call. Call it in the didFinishLaunchingWithOptions method that is inside your application delegate class. In versions before the Workspace ONE SDK v17.x, you called awcontroller.start() within the applicationDidBecomeActive method. 3 Build your project. 4 Resolve naming differences and API differences that changed in the new SDK causing build errors. Share Your Keychain Share your keychain between the SDK applications so you can use all the SDK capabilities. See Keychain Access Group Entitlements. Component Changes in the VMware Workspace ONE SDK for iOS (Swift) If you migrate an older version of the SDK to install it, review the list of changed components. Update names and locations of components to prevent or resolve build errors caused by the differences between SDK versions. Samples present the old version of the code followed by the current code. VMware, Inc. 7 VMware Workspace ONE SDK for iOS (Swift) Table 2‑1. Workspace ONE SDK for iOS (Swift) Components with Examples of Objective-C and Swift Code Component Sample Code AWController start ///5.9.X Implementation In the previous SDK you called func applicationDidBecomeActive(_ application: UIApplication) awcontroller.start() within the let awc = AWController.clientInstance() applicationDidBecomeActive awc.delegate = self method. awc.callbackScheme = "myAppName" awc.start() In the current SDK, start the SDK } within the didFinishLaunchingWithOptions ///Swift version Implementation method inside your application func application(_ application: UIApplication, delegate class. didFinishLaunchingWithOptions launchOptions: You will get inconsistent UI [UIApplicationLaunchOptionsKey: Any]?) -> Bool { behaviors from the SDK if you do let awc = AWController.clientInstance() awc.delegate = self not make this change. awc.callbackScheme = "myAppName" awc.start() return true } CanhandleProtectionSpace ///5.9.X Implementation (Integrated Authentication) try Update the code for authentication AWController.clientInstance().canHandle(challenge.protectionsSpace) challenges and chain validation. ///Swift version Implementation try AWController.clientInstance().canHandle(protectionsSpace: challenge.protectionsSpace ) AWLog singleton (Logging) ///5.9.X Implementation Use this instead of the AWLog.sharedInstance().sendApplicationLogs(success, errorName) AWController to send logs. ///Swift version Implementation AWController.clientInstance().sendLogDataWithCompletion { (success, error) } Network status ///5.9.X Implementation Update the front of the enum to AWNetworkActivityStatus