AirWatch Hands-on LabsInternal HOLsAWTMA-HOL-17-DevWorkshop-iOS ArticlesIntegrate AirWatch iOS SDK with Room Finder app

Integrate AirWatch iOS SDK with Room Finder app

In this section, we will include AirWatch SDK framework into Room Finder app.

1. SDK Initial Configuration

1.1. Add the Native Framework using Source Tree

Add the Native Framework using Source Tree

We have already installed Source Tree and configured that with the roomfinder2016 repository.

  1. From the repository, check out the commit "Required Frameworks added".

1.2. Native Xcode frameworks

AirWatch iOS SDK is dependent on the following native Xcode frameworks to function properly. To limit the scope of this workshop, these are already added for you.

  1. Click on "Room Finder" in the left most column.
  2. Select target "Room Finder" from TARGETS. If you are not seeing this column, please unhide it using the option as hide-unhide tool as per the screenshot.
  3. Select the option "Build Phases".
  4. Expand "Link Binary with Libraries". You should see 29 items in the binaries list which are required to run the AirWatch iOS SDK successfully.

The complete list of these frameworks can be found in VMware AirWatch iOS SDK Technical Implementation Guide.

1.3. Valid Architectures

AirWatch iOS SDK currently supports the following architectures: ARMv7, ARMv7S, ARM64. Do not compile the i386 architecture/simulator because the SDK only supports real physical devices.

  1. Click on "Room Finder" in the left most column.
  2. Select target "Room Finder" from TARGETS. If you are not seeing this column, please unhide it using the option as hide-unhide tool as per the screenshot.
  3. Select the option "Build Settings".
  4. Observe the Valid Architectures as "arm64 armv7 armv7s".

1.4. Linker Flags

Linker Flags

Since the AirWatch SDK uses Objective-C categories, you must pass linker flags to the linker to properly load them.

  1. In the same Build Settings options, type in "Other Link" in the search box to filter out the options.
  2. Observe that Other Linker Flags is set to "-ObjC".

1.5. Bitcode settings

Bitcode settings

Similarly,

  1. Enter "bitcode" in the search box to to filter out the options.
  2. Observe that "Enable Bitcode" is setup to "No".

2. Add AirWatch SDK Framework

All the AirWatch SDK files are packaged into AirWatchSDK.dmg file. Navigate to the DMG file and extract to view the contents of the file. Next, we will drag and drop the required framework files into the Room Finder project.

2.1. Select SDKLocalization.bundle

Select SDKLocalization.bundle
  1. From Finder on your Mac, select "Desktop".
  2. Click on "5.9.1.2".
  3. Click on "SDKLocalization.bundle".

2.2. Drag and drop SDK Localization Bundle

Drag and drop SDK Localization Bundle
  1. Drag and drop SDKLocalization.bundle into the folder "Frameworks" in the sidebar of Xcode.
  2. Select the Destination option as "Copy items if needed".
  3. Click on "Finish" to import.

2.3. Select AWKit.bundle

Select AWKit.bundle

Back to Finder on your Mac,

  1. Click on "Desktop".
  2. Double click on "5.9.1.2/ AWSDK.framework" to expand.
  3. Click on "Versions".
  4. Click "A".
  5. Select "AWKit.bundle".

2.4. Drag and drop AWKit bundle

Drag and drop AWKit bundle
  1. Drag and drop AWKit.bundle into the folder "Frameworks" in the sidebar of Xcode.
  2. Select the Destination option as "Copy items if needed".
  3. Click on "Finish" to import.

2.5. Select AWSDK.Framework

Select AWSDK.Framework
  1. Click on "Desktop".
  2. Select "5.9.1.2".
  3. Select "AWSDK.framework".

2.6. Drag and drop AWSDK.Framework

Drag and drop AWSDK.Framework
  1. Drag and drop AWSDK.framework into the folder "Frameworks" in the sidebar of Xcode.
  2. Select the Destination option as "Copy items if needed".
  3. Ensure that Added folder option is selected as "Create groups"
  4. Ensure that Add to targets option is selected as "RoomFinder".
  5. Click on "Finish" to import.

Note: Link Binary With Libraries should now have 30 items and you should see AWSDK.framework in the list. If not, click on the "+" sign at the bottom and navigate to AWSDK.framework to add.

2.7. Verify Copy Bundle Resources

In the Xcode project settings,

  1. Navigate to "Build Phases".
  2. Expand the option "Copy Bundle Resources"
  3. Ensure that you can see "SDKLocalization.bundle" and "AWKit.bundle" in the list.

3. Register URL Schemes

Register URL Schemes

In order for the Room Finder app to receive SDK configuration from AirWatch agent, we need to register AirWatch Agent's URL scheme in the info.plist file.

Note: For this workshop, we are using AirWatch agent based enrollment. Hence, AirWatch agent acts as anchor / broker app to authenticate Room Finder app while it fetches the SDK settings.

  1. From the side panel, expand the folder "RoomFinder".
  2. Click on "Info.plist".
  3. Add a new Information Property as "LSApplicationQueriesSchemes" with the type "Array".

3.1. Add AirWatch Agent's URL scheme

Add AirWatch Agent's URL scheme
  1. Expand the Array "LSApplicationQueriesSchemes".
  2. For item 0 select the type "String" and enter the value as "airwatch". Hit return/ enter to continue.

3.2. Application's Callback Scheme Registration

Application's Callback Scheme Registration

Similarly, we also need to register Room Finder applications URL scheme to receive a callback from AirWatch Agent. This step insures that AirWatch agent launches the Room Finder after delivering the SDK configuration successfully.

  1. Add another Information Property List as "URL types". The type should be auto-selected as "Dictionary".
  2. After expanding Item 0 of the dictionary, select "URL Schemes". The type should be auto-selected as "Array".
  3. After expanding Item0 of the array, select type as "String" and value as  "roomFinder". Hit return/ enter to continue.

0 Comments

Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.