Sunday, December 13, 2015

programmatically implement Single-App Mode in IOS 7 and above

Hi All,

Recently i had to work on a app where the requirement is to lock the device(iOS) to Single-App mode, i.e the device to lock to the app and even when restarted it should boot back to the same app.

I had to use the  UIAccessibilityRequestGuidedAccessSession api
 to make it work. the code is pretty simple as mentioned in the Apple document and SO.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/index.html#//apple_ref/c/func/UIAccessibilityRequestGuidedAccessSession

as mentioned there pass YES to lock, NO to unlock. The call back method didSucceed actually confirms whether it worked or not.

Here are the things with my app and the steps i performed.


  1. Supervise the iPad/iphone using the Apple Configurator.
  2.  Install the MDM related files ( Each MDM has its own set of instructions, usually involves downloading a profile).
  3. Every MDM has a option of Single APP Mode or MultipleAppMode. Select the second option and add the app IDs to the list. (A single APP mode works pretty well with MDM's but i did not want the app to be locked to a single APP all the time).
  4. As mentioned used the UIAccessibilityRequestGuidedAccessSession to lock at the beginning and unlock at the end.
  5. FYI.. this is a Enterprise App as you must have already noticed but just wanted to mention.

Thanks,
Bob :)






5 comments:

  1. Hi Thanks for the blog, but do you know what MDM you used for this purpose ? is there any Test MDM available for this ? if you can share further information will be highly appreciated.

    ReplyDelete
  2. I used two three different things. one i currently use is Airwatch. Almost all MDM's work the same way.

    You could try Meraki and see if it works for you.

    Thanks,
    Bob

    ReplyDelete
  3. Is it possible to make system app default to the user app like in true caller the phone and contact app does.

    ReplyDelete
  4. Link is not working. Can you please suggest any other link.
    Thankx

    ReplyDelete