I am writing an iOS client app that sends a request to a server who turns around and requests that an updated configuration profile be pushed to my device via external MDM (AirWatch). I believe the profile shows up in Settings -> General -> Profiles
. When the MDM finishes processing the profile push (sent or queued, I'm not sure), it responds to the calling server saying 'yes the profile was pushed' who echoes that response to my client app.
The problem is that it takes about 30 seconds for the profile to actually get pushed / installed on the device, while the web service response is much shorter than that. So my client app believes the configuration profile has been installed, and it allows the app to continue while the profile is still unavailable. I would like to be able to detect when the profile is successfully pushed to my device, and not allow the app to continue until afterwards. My other option is to make a pop-up saying the profile was successfully pushed, but I would still need to detect the profile being installed.
Most of the 2013 Q&A on stackoverflow appears to say it is not possible to query configuration profiles, but I was wondering if there are any work-arounds people have recently tried. I thought of the following possibilities - but I don't know which is preferred, or if it is even possible with iOS7 (as of 2/12/2014).
- Query the installed profiles for the one I need (sounds impossible
from most Q&A I've seen; don't know if updates to iOS7 has changed
this)
- What if I knew the exact profile name I was looking for?
- Add a notification listener for MDM pushes
- Use
registerForRemoteNotificationTypes
/didReceiveRemoteNotification
ordidFinishLaunchingWithOptions
- The MDM push may happen outside of my app, so sandboxing may get in the way
- Can you listen to the port the MDM is using?
- Use
- Listen for changes to the profile configuration settings
- Add a request at the server to query the device for the installed profile, and call that prior to sending a response to the client
- Do certificate validation by including a self-signed cert in the profile and verifying it
- Seems a little hacky and I’m not sure if my MDM will allow me to do it
- Use reachability methods
As a note I have looked at the following links plus more:
- WWDC 2013 MDM slides - didn't see anything that stood out
- iOS get Configuration Profiles that are installed
- Verify/Check to see if a Configuration Profile has been installed on iPhone (from 2010)
Thanks in advance!