9

I'm making an application that needs users' complete attention till a specified target is achieved. before achieving the target, if a user tries to press 'home' button it should be disabled, or like 'kiosk mode' in ios6. I just needed to be done programmatically while start the application, dont like to do anything by manually changing in settings menu in iPhone/iPad After completion of target in my application, home button should be enabled. The application is targeted for enterprise. So no need for app store approval. How to do this? thanks in advance.

Edit: I read about "mobile configuration plist". That needed to reboot the device. But I dont like to reboot the device. Once when my application is started it should take care of everything(programmatically). I dont want the users/supervisor intervention in this. Just want to disable home button like in 'Guided access' but with programmatically inside my app. Is there any private api available from 'Guided Access' to disable the home button?

Note: Not for a Jail broken device. Targeted for enterprise licensed app.

Ka-rocks
  • 774
  • 1
  • 14
  • 27
  • 1
    I don't think that is allowed ... – Sagrian Feb 25 '13 at 13:59
  • "mobile configuration plist" needed to reboot the device. But I dont like to reboot the device. Once my application is started it should take of everything(programmatically). I dont want the users/supervisor intervention in this. Just want to disable home button like in Guided access but programmatically. – Ka-rocks Feb 25 '13 at 15:08

2 Answers2

11

Zachary Christopoulos has a post on this using a "mobile configuration plist".

Once this profile is installed the first app that is launched when the device is rebooted will be the only app that will run until you reboot the device again.

Example plist from Zachary's post:

<?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>
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
  • Thanks. But i dont like to reboot the device. Once my application is started it should take of everything(programmatically). I dont want the users/supervisor intervention in this. – Ka-rocks Feb 25 '13 at 15:06
  • That is no longer supported on iOS 7. It is not the official way. https://devforums.apple.com/thread/216385?tstart=0 – Krešimir Prcela Jan 16 '14 at 11:55
  • 1
    we have to use App Lock Payload (PayLoadType=com.apple.app.lock) As per the iOS 6 Configuration profile reference(https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010206-CH1-SW4). @Rjstelling consider giving an sample plist file for iOS 7 so that it becomes one stop shop for this kiosk mode setting. – Durai Amuthan.H Jan 20 '14 at 13:24
2

Without employing private frameworks or having the device jailbroken you cannot disable the home button automatically. The closest thing you can do is have your end user employ the use of Guided Access to require a triple-click of the home button to exit the application. Guided Access must first be turned on in the Settings Application under General->Accessibility.

See Also: Disable Home Button Without Rebooting Device - Stack Overflow

Community
  • 1
  • 1
WhoaItsAFactorial
  • 3,538
  • 4
  • 28
  • 45