Disable home button without rebooting device

后端 未结 4 1465
执念已碎
执念已碎 2020-12-30 05:35

I want that after installing my app from an OTA the home button of the device will not work at all so that user is unable to come out from the App. My digging led me to foll

相关标签:
4条回答
  • 2020-12-30 06:12

    Without jailbreaking, the app is sandboxed. The app simply does not have access to mess with the home button. And you really shouldn't be messing with the home button.

    In addition to "Guided Access", you can also make use of "Restrictions", which will allow you to disable everything accept opening your app. You can disable Apple specific apps including Safari, and prevent users from installing apps, deleting apps, making purchases, etc...

    We have a number of iPod touches with a ticket scanning app we rent out to our customers. We make use of "Restrictions" to disable everything besides our app. The most helpful restriction thus far is preventing people from deleting apps - It's incredible how many people will accidentally delete an app, even after the warning prompt.

    0 讨论(0)
  • 2020-12-30 06:19

    The official answer of this question is "you can not disable home button in ios devices it is os level architecture and your are not authorized for it."

    You need to dig to operating system flow to make any changes which might be quiet tough.

    well, if you change you sight though it than there is one open and simple solution for this in ios 6 known as Guided Access.

    0 讨论(0)
  • 2020-12-30 06:22

    If you are able to jailbreak your device create a LaunchDaemon or use an existing one. The LaunchDaemon is a file in plist format that is called upon rebooting and starting your device. You will also need a file named open created by K3A

    Download open from here

    You will need to move open to /usr/bin/ or you can put it inside your app does not matter but set permissions to 0755 and root:wheel

    Now on to the LaunchDaemons, they are stored here

    /System/Library/LaunchDaemons
    

    Here is an example. Lets say you name the LaunchDaemon

    com.gauravstomar.test.plist
    

    Where it says com.bundle.identifier put your apps identifier you may also find it in your Info.plist inside of your apps directory where it says CFBundleIdentifier

    Now inside the plist insert the following information

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.gauravstomar.test</string>
        <key>ProgramArguments</key>
            <array>
              <string>open</string>
              <string>com.bundle.identifier</string>
            </array>
        <key>RunAtLoad</key>
        <true/>
            <key>StartInterval</key>
            <integer>1</integer>
    </dict>
    </plist>
    

    Label has to be the same name as the LaunchDaemon.plist excluding plist extension

    ProgramArguments is what calls the file open and launches the app

    RunAtLoad makes this plist launch upon reboot

    StartInterval will make the LaunchDaemon.plist open back up after 1 second if the user exits the app, if the user is still in the app nothing will happened

    Make sure the permissions for your LaunchDaemon is set to

    0644 root:wheel
    

    You can still use your mobileconfig so that the home button is disabled. Once assessment is complete you can disable the LaunchDaemon so that the app stops relaunching itself with the following command launchctl unload/System/Library/LaunchDaemon/com.gauravstomar.plist

    Let me know if you need any more help.

    0 讨论(0)
  • 2020-12-30 06:24

    In iOS6, there's a feature called "Guided Access", which will allow device owners to lock users (like toddlers and school kids) into an app.

    This explains the Guided Access for iOS 6 apps.

    0 讨论(0)
提交回复
热议问题