iOS app: Managed App Config

Hi everone.

We have an iOS app that serves many hospitals across the US. Our app is available to the public through the app store. So, our clients connect their Apple Business Manager account to their MDM servers. 

We want to add a feature to our app that decides if a user has to use regular login or SSO login. To do this, we have to find a way that let our clients distribute a configuration file with the help of their MDM servers. The file should contain the SSO login URL. I'm wondering if there is any way that would help us to do this.

I have read about this on Apple website: 


Managed App Config
Starting with iOS 7, Apple added support for managed application configuration. An MDM server can push a configuration to the iOS App. The app can access the configuration using the NSUserDefaultsclass. The configuration is basically a key-value dictionary provided as a .plist file.



but I can't see a way or an example to do this. Would please help .

Thanks
Answered by sysedit in 660422022
Not sure what you're exactly looking for, but basically:
  • your app needs to implement code to react to app config being sent. Look at https://developer.apple.com/documentation/foundation/nsuserdefaultsdidchangenotification and NSUserDefaults class documentation. In a nutshell there is a function called when the config is sent by the MDM with a dictionary with all key/values.

  • you need to provide to your customers a plist containing the dictionary.

  • your customers need to use their MDM to send the configuration to the apps.

At this point, it really depends on the MDM implementation.
Disclaimer : I'm working for one MDM vendor ; with our solution, you can easily import the plist and attach it to the application you want to deploy to devices and we offer some flexibility (you can deploy different plists on different devices based on rules or customize the plist on the fly).

But the MDM protocol is quite simple : the config can be sent to the device at installation time or afterwards, and once the config is sent the app receives the callback, the rest really depends on the implementation of the MDM tool.

You may find appconfig.org helpful.
Search for
AppConfig Community

Accepted Answer
Not sure what you're exactly looking for, but basically:
  • your app needs to implement code to react to app config being sent. Look at https://developer.apple.com/documentation/foundation/nsuserdefaultsdidchangenotification and NSUserDefaults class documentation. In a nutshell there is a function called when the config is sent by the MDM with a dictionary with all key/values.

  • you need to provide to your customers a plist containing the dictionary.

  • your customers need to use their MDM to send the configuration to the apps.

At this point, it really depends on the MDM implementation.
Disclaimer : I'm working for one MDM vendor ; with our solution, you can easily import the plist and attach it to the application you want to deploy to devices and we offer some flexibility (you can deploy different plists on different devices based on rules or customize the plist on the fly).

But the MDM protocol is quite simple : the config can be sent to the device at installation time or afterwards, and once the config is sent the app receives the callback, the rest really depends on the implementation of the MDM tool.

Thanks all for your help. @sysedit : Do you know if it does matter how clients get the app? For example, if they downloaded the app using an Apple Business Manager that is connected with MDM server, OR by uploading package file and the signing certificate into the MDM server? 

I'm not sure if this way (send plist to the app) only works when the MDM sign the package ?
It should not matter.

https://developer.apple.com/documentation/devicemanagement/installapplicationcommand/command?changes=latest_minor&language=objc

InstallApplication command can contain Configuration which is the configuration plist - and this should work for both IPA or via iTunesID (ASM/ABM).

In addition, the Setting command allows to update the configuration once the app has been installed:
https://developer.apple.com/documentation/devicemanagement/settingscommand/command/settings/applicationconfiguration?changes=latest_minor&language=objc

And this is based on bundle id - so unrelated to how the app has been installed.

@sysedit Thank you so much. those links are really so helpful
iOS app: Managed App Config
 
 
Q