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
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.
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.