8 Replies
      Latest reply on Aug 7, 2018 1:39 AM by eskimo
      Nubi Level 1 Level 1 (0 points)

        I am very new to the iOS app develeping community and the life of programming in general so there are many "impossible" or "restricted"  areas that I have in my head but this question for might steer myself to making something great. The answers that I found out through the web showed me nothing besides people only saying "You can't do that". Also reading the developers agreement I am aware that I can not allow to temper with the iOS security solution, but only if you have a written permission by Apple. Upon reading that, my question is can the Home Button on an iPhone be blocked TEMPORARILY through the choice of the user by a set time duration in Xcode?

        • Re: Allow Home Button block for time duration
          eskimo Apple Staff Apple Staff (9,855 points)

          Upon reading that, my question is can the Home Button on an iPhone be blocked TEMPORARILY through the choice of the user by a set time duration in Xcode?

          Yes, and no.  iOS supports three different modes with restrictions on the Home button:

          • Users can enable Guided Access, which locks the device into a specific app.

          • System admins can restrict the device to running a single app via the App Lock payload.  This requires the device to be supervised.

          • System admins and app developers can cooperate to set up Autonomous Single App Mode.  Specifically:

            • The system admin lists the app in the autonomousSingleAppModePermittedAppIDs list set via the Restrictions Payload.

            • The app developer enables and disables single app mode by calling UIAccessibilityRequestGuidedAccessSession.

            This also requires the device to be supervised.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Allow Home Button block for time duration
              Nubi Level 1 Level 1 (0 points)

              So the only way that the Home Button on the iPhone can be disabled in duration is if the device is supervised or with guided learning? Is it possible for the app itself to disable the Home Button? Without any use of MDM servers or supervision? If not, then is the answer the same about having an app disable the activation of other apps for a time duration?

              • Re: Allow Home Button block for time duration
                eskimo Apple Staff Apple Staff (9,855 points)

                iOS supports three different modes with restrictions on the Home button:

                Modern versions of iOS support a fourth mode, Automatic Assessment Configuration.  To learn more about all four modes, I recommend watching WWDC 2017 Session 716 iOS Configuration and APIs for Kiosk and Assessment Apps, which covers them all in detail (and is highly amusing to boot).

                Share and Enjoy

                Quinn “The Eskimo!”
                Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                let myEmail = "eskimo" + "1" + "@apple.com"

                  • Re: Allow Home Button block for time duration
                    frank_developer Level 1 Level 1 (0 points)

                    Hi, @eskimo.  When using "Autonomous Single App Mode", how could the app know whether itself is in the whitelist or not?   Is there any API to indicate this ?  Thanks for your help.

                      • Re: Allow Home Button block for time duration
                        eskimo Apple Staff Apple Staff (9,855 points)

                        The obvious answer here is to call UIAccessibilityRequestGuidedAccessSession and see if it fails.  However, I suspect that I’ve missed some subtlety in your question.  If so, please clarify.

                        Share and Enjoy

                        Quinn “The Eskimo!”
                        Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                        let myEmail = "eskimo" + "1" + "@apple.com"

                          • Re: Allow Home Button block for time duration
                            frank_developer Level 1 Level 1 (0 points)

                            Thanks very much. What I mean is whether there exists an API indicating this before calling UIAccessibilityRequestGuidedAccessSession? There isn't a notification to app when it's added to the whitelist, thus I don't want my app continuing to call this API to try forever.

                              • Re: Allow Home Button block for time duration
                                eskimo Apple Staff Apple Staff (9,855 points)

                                What I mean is whether there exists an API indicating this before calling UIAccessibilityRequestGuidedAccessSession?

                                Ah, I see.  I think you’re right on that front but this is somewhere outside of my area of expertise.  You have a couple of options here:

                                • You could assume you’re right and file an enhancement request for this feature.

                                • You could open a DTS tech support incident, talk to our single-app mode specialist, and get a definitive answer.  Of course, that definitive answer may be “No, file an ER”, but at least you’d know for sure.

                                Share and Enjoy

                                Quinn “The Eskimo!”
                                Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                                let myEmail = "eskimo" + "1" + "@apple.com"