Lock iOS App in Single App Mode Programmatically

How to lock down user to Single App mode in iOS 6, Programmatically?

The SureLock iOS app does nothing but inform the user how to do it in your system preferences.

Doing it from the app itself is only possible, if you break the rules about private frameworks. And break it hard.

I am sorry to tell you that the way you present your idea, would never be approved for the AppStore.

How to kill an iOS app running in Single app mode everyday at a specific time?

exit(0)

is the code to kill your app programatically. How you do it is at a particular time or event is left upto you. You can send a push notification and kill the app on the push notification or a local notification which is fired at a particular time.

While as for starting up an app it is not possible unless it be for VOiP apps which are brought into foreground directly in case of an incoming call.

Hope this helps and clear out your doubts.

Happy Coding!

Please refer these SO Post 1, SO Post 2, Restarting App.

But using exit(0) would lead to app rejection on AppStore.

How to kill an iOS app running in Single app mode everyday at a specific time?

exit(0)

is the code to kill your app programatically. How you do it is at a particular time or event is left upto you. You can send a push notification and kill the app on the push notification or a local notification which is fired at a particular time.

While as for starting up an app it is not possible unless it be for VOiP apps which are brought into foreground directly in case of an incoming call.

Hope this helps and clear out your doubts.

Happy Coding!

Please refer these SO Post 1, SO Post 2, Restarting App.

But using exit(0) would lead to app rejection on AppStore.

How can I programmatically enable Guided Access (Kiosk mode) on an iPhone?

You can enter and exit guided access mode from within your app. However, to do so the device has to be supervised, and have an MDM profile installed that has the app's bundle ID in the list of applications that can request guided access mode (the key is autonomousSingleAppModePermittedAppIDs.

Once that is done, to enter guided access you do this:

UIAccessibility.requestGuidedAccessSession(true){
success in
print("Request guided access success \(success)")
}


Related Topics



Leave a reply



Submit