AirWatch Developer Guide for Xamarin iOS
App Configuration > AppConfig.org (Xamarin iOS)
Overview
This tutorial will walk developers through how to send dynamic configurations to an app by utilizing the native iOS managed configuration capability as prescribed by the AppConfig.org standard. The steps in this tutorial are done with the assumption that you have gone through the steps in General Setup tutorial.
Requirements
- Minimum Project Deployment Target iOS 8.0 or above
- Requires AppConfig.org configuration from an Mobile Device Management (MDM) server to enable
Getting Started
- Either add the
ManagedAppConfig
Project to your existing Solution, or build theManagedAppConfig.dll
and add it to the References section of your Project. - Modify
AppDelegate.cs
to import theManagedAppConfig
DLL:using ManagedAppConfig;
- Modify the
AppDelegate
class definition to implementIManagedAppConfigSettingsCallback
:public class AppDelegate : UIApplicationDelegate, IManagedAppConfigSettingsCallback
- In your
AppDelegate.cs
add the following lines withinFinishedLaunching
:public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) { ManagedAppConfigSettings.ClientInstance.callback = this; ManagedAppConfigSettings.ClientInstance.Start (); return true; }
- Implement the
IManagedAppConfigSettingsCallback
interface:public void SettingsDidChange (Dictionary<string, object> changes) { foreach (KeyValuePair<string, object> entry in changes) { var message = String.Format ("Changed: {0} : {1}", entry.Key, entry.Value); Debug.WriteLine (message); } }
- Modify this callback to consume the changes as makes sense for your app. Some recommended keys for your MDM server are defined in
ManagedAppConfigKeys.cs
. Using these keys will help your app and its configuration be consistent with best practices.