1

I need to build an iPad application, which when the user launches, brings the iPad in kiosk mode. I went through several links, but could not find a proper answer. I don't know where to start from.

Somewhere I read that I need to include a mobile configuration file to my device:"

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadDescription</key>
            <string>Disables the home button.</string>
            <key>PayloadDisplayName</key>
            <string>Home Button Lock</string>
            <key>PayloadIdentifier</key>
            <string>com.zchristopoulos.kiosk</string>
            <key>PayloadOrganization</key>
            <string>Zachary Christopoulos</string>
            <key>PayloadType</key>
            <string>com.apple.defaults.managed</string>
            <key>PayloadUUID</key>
            <string>B2D02E2D-BAC5-431B-8A29-4B91F71C9FC1</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>PayloadContent</key>
            <array>
                <dict>
                    <key>DefaultsDomainName</key>
                    <string>com.apple.springboard</string>
                    <key>DefaultsData</key>
                    <dict>
                    <key>SBStoreDemoAppLock</key>
                    <true/>
                    </dict>
                </dict>
            </array>
        </dict>
    </array>
    <key>PayloadDescription</key>
    <string>Disables Home Button</string>
    <key>PayloadDisplayName</key>
    <string>Home Button Lock</string>
    <key>PayloadIdentifier</key>
    <string>com.zchristopoulos.hbkill</string>
    <key>PayloadOrganization</key>
    <string>Zachary Christopoulos</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>614D1FE3-F80D-4643-AF6B-D10C4CC8737A</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

How to do this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Shradha
  • 991
  • 3
  • 13
  • 38

3 Answers3

4

The device must be in supervised mode and be distributed with a MDM platform. Use this function to enable the guided mode:

UIAccessibilityRequestGuidedAccessSession()

The docs say:

Use UIAccessibilityRequestGuidedAccessSession() to request this app be locked into or released from Single App mode. The request to lock this app into Single App mode will only succeed if the device is Supervised, and the app's bundle identifier has been whitelisted using Mobile Device Management. If you successfully request Single App mode, it is your responsibility to release the device by balancing this call.

You can use Meraki as MDM platform. Its free https://meraki.cisco.com/products/systems-manager

zeiteisen
  • 7,078
  • 5
  • 50
  • 68
  • Hi.. I am putting my device in supervised mode.. it's in process.. But what do you mean by "and be distributed with a MDM platform"?? How to do this?? I followed your link, but it's completely unclear to me what to do next.. Can you please elaborate?? – Shradha Mar 19 '14 at 10:59
  • @zeiteisen thanks for the tip to use Meraki! Do you happen to know if only an app installed from the AppStore is allowed to request single app mode? I have a supervised device, with a Meraki configuration profile that has restrictions set with the `Allowed Single App Mode` setting set to my app. But the call to UIAccessbilityRequestGuidedAccess() still fails in my app. Device logs only show an entry saying 'Rate controlled' connection 'app name' access to protected services is denied. – Sandeep Phadke Mar 26 '14 at 20:04
0

This is a recurring question. You can't do this from within your app, at least on a device which is not jailbroken.

It is true that you can achieve this using the iPhone Configuration Utility, but this solution is available only to businesses and won't allow autmatic kiosk mode for a single app either.

So your best shot is to just use Guided Access. You may want to take a look at this question and its answers as well.

Community
  • 1
  • 1
Toastor
  • 8,980
  • 4
  • 50
  • 82
  • yes.. i went through this question and its corresponding answer.. However, i am not able to understand how to make my .mobileconfig file.. – Shradha Mar 19 '14 at 08:57
  • This answer is no longer up to date: it is possible from within the App, if the iPad was setup as supervised mode and the App uses https://developer.apple.com/documentation/uikit/1615186-uiaccessibilityrequestguidedacce?language=objc – Lepidopteron Feb 22 '19 at 06:38
0

What I believe you want to do is load the plist from a remote server, which the device will ask if you trust. If so, then the app should go into locked mode (that's what SBStoreDemoAppLock is about: referenced here: http://www.zchristopoulos.com/2012/02/how-to-disable-ipad-home-button-kioskstore-demo-mode/ and here: http://rick-hawkins.blogspot.com/2012/01/turning-ipad-into-kiosk-device.html). I believe @Toaster is wrong about it being jailbroken, as you're looking to use a config.

This link should really help you: https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010206-CH1-SW53

Aside from that, also if you want to try for a relatively simple configuration, try out Apple's Configurator (linked on the dev page).

One thing to note about the solution about putting it into Guided Access Mode is that it gets reset when the device is restarted. the .plist solution should hold until the plist is explicitly deleted.

lordB8r
  • 370
  • 2
  • 12