AirWatch Developer Guide for Xamarin iOS
App Configuration > AirWatch SDK (Xamarin iOS)
Overview
The steps in this tutorial are done with the assumption that you have gone through the steps in General Setup tutorial as well as the SDK Setup section.
Important: You will need to download the SDK binary separately via https://components.xamarin.com/view/awsdk.
Requirements
- iOS 7+
- Visual Studio or Xamarin Studio
- iOS Test Device
- AirWatch SDK Binding from the Xamarin Component Store
Tutorial
Step 1: Integrate the AirWatch SDK
Follow the instructions to integrate the AirWatch Software Development Kit (SDK) for Xamarin iOS into your application if you haven’t already done so.
Step 2: Add Custom Settings in your SDK profile
For this next part, you will need to check which profile you have assigned to your SDK app. You can do this by navigating to Apps & Books > Details View. Click Edit. Choose More > SDK. Check what profile is assigned for SDK Profile.
Using the Default SDK Profile (Recommended)
- If the profile assigned is the default profile, then the policy settings can be edited by navigating to Apps & Books > All Apps & Books Settings > Apps > Settings And Policies > Settings.
- Enable the custom settings and add your custom settings. This is a string field and can contain XML, JSON, or plain text. You can also insert lookup values if desired.
- Once you are done, click save to start enforcing the new policy.
Using a custom profile
- In the *AirWatch Console, Choose Apps & Books > All Apps & Books Settings.
- Choose Settings and Policies > Profiles and click Add Profile to create a custom profile or edit an already existing profile currently assigned to your app.
- You will be asked to Choose SDK Profile or Application Profile. Select the SDK profile.
- Choose iOS and fill in the Name field on the General Tab.
- Click Custom Settings on the left, and add your custom settings. This is a string field and can contain XML, JSON, or plain text. You can also insert lookup values if desired.
- Save the Profile.
Step 3: Retrieving the Profile within Your Application
The code to retrieve these settings within the app is very simple if SDK integration in the setup section in step 1 is already done.
override public void ReceivedProfiles (AWProfile[] profiles)
{
if (profiles.Length > 0) {
AWCustomPayload custom = profiles [0].CustomPayload;
String customSettings = custom.Settings;
...
}
}
Here is a screenshot from the debugger showing the sample XML settings entered in the AirWatch Console above:
Use these settings however you wish in your app!