how activate/desactivate the "slide to unlock" on iphone? - iphone

All is in the question, i would know if it is possible to activate/desactivate the "slide to unlock " event wich is normally activate/desactive through Settings->General->Passcode Lock
I'm almost certain that we could not play with those setting. I still want to know how we can do that. I suppose we have to use a private framework like some UIView animation, i want to know that for my personal use, it is not an AppStore app project

Thats not possible with the public API and an un-jailbroken device. and if your app does that, it will never be accepted to the appstore

Related

Close iPhone app from within the app

Is there a way to close the iPhone app from within the app? A client asked me if there was a way to close the app by pushing a button in the app, without manually doing it by double tapping the home button and then press-hold the app icon and then hit the - sign.
Apparently, the client wants to build an app which uses bluetooth and ANT+ devices which are battery hogs and wants the ability to quickly close the app.
Any thoughts?
I'm thinking you should just make the button dispose of the Bluetooth and other 'battery hogs'. You might even make the app smart enough to turn it off based on certain events like when the user leaves the app or when a certain function is completed.
Aside from quitting from a button within the application being against the Apple Human Interface Guidelines, it isn't even recommended behaviour.
But if you still want to close your app. Use 'exit();'.
This behavior is against Apple's Human Interface Guidelines. If you still want to do so, use the C function exit();. But for the user this will look like the application crashed, so I wouldn't do so, even not on an non-AppStore app!

After unlock iPhone application must be active in background

In my application I want that my application being active even after termination of application. I want that when "slide to unlock" my appliaction is launched.
It is possible? How can I do it without jailbreaking & all...
It is a convenience feature for the user. The application is an audio player and should start playing music immediately when the user unlocks his iPhone or speaking a text "Welcome to iPhone" or something like that.
Please clarify more about it that what you want to do. For this you might be use jail broken tools.
Use this link
http://www.redmondpie.com/how-to-unlock-any-jailbroken-iphone-on-any-baseband-and-firmware/
http://www.redmondpie.com/how-to-unlock-any-jailbroken-iphone-on-any-baseband-and-firmware/

Assigning app functionality to silent/mute switch in iOS

Is it possible to programmatically link the physical mute/silent switch to an app function?
I would like to use the mute/silent switch as a toggle to lock/unlock aspects of an app (not sound-specific, but the app does not rely on audio so mute or not is actually moot. ;)
I think you can do that by capturing the hardware button call back; capturing the callback is explained by #John Fricker here.
But the app may be rejected by apple 'cos as per app store review guidelines
10.5 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected
No, it is only for Lock Rotation or Mute. You can choose it in Settings app.
but it seems to be possible to detect the state of the mute switch.
How to programmatically sense the iPhone mute switch?
This can be done, an app That does this will not be rejected by Apple because first, there's already two apps on the AppStore does this. Second the appstore review guidlines say that you cannot alter the standard function, but we are not trying to alter the finction, we are using the same function.

Device auto-lock

I have an application in which I want to lock the iPhone programmatically so that the user can't perform any action.
How can I determine the user is not working with the iPhone for some period, and after that period automatically lock the phone?
Such applications are used in all phone devices, where the user can set an auto-lock time and then the device will automatically lock if the user does not handle the device.
How is it done programmatically? Please give me one example of the code so I can perform this easily.
I am new to iPhone programming, and I am struggling in my application. Help me. Thanks in advance.
(For your lock the iphone device through programatic only )
Impossible.
But , you could prevent your phone from locking when your app is running.
[UIApplication sharedApplication].idleTimerDisabled = YES
There is no way to disable the Home Button in iOS using the documented API. The user will always be able to get back to the home screen or close your application using the Home Button.
Even if you find a way do it (which is very unlikely) your app will be definitely rejected from the App Store for a blatant violation of the iOS Human Interface Guidelines. If I were you I would reconsider implementing this behaviour, frankly, it's just not a good idea.
If you're only looking for blocking the the UI of your app, check out the answers to this question, more specifically, check out the incredibly useful MBProgressHUD library:

Temporarily Lock or Disable iphone home button

I know the iphone home button is extremely crucial for the functioning of the iphone.
However I have an idea for which I need the application running and the home button to be disabled. I tried googling, but haven't been able to find a solution.
Temporary or timed locking (Lock for 5/10 mins.) would also do.
The app. should work on non-jailbroken phones, hence going around apple won't work.
Appreciate any ideas.
Note, from 2014 onwards: just to be clear,
this is now built in to iOS...
Click to accessibility, click "guided access".
Conrats for "inventing" it, PlanetUnknonw! :-)
The answer below is only of historic value...
For the record, it's silly that people are saying "Why would you want to do this?"
it's a great idea for example for APPS FOR SMALL CHILDREN (which is indeed a very large market on the iPhone).
If you've ever marketed an app for small children, you'll know that instantly parents write in abusing you because you "did not stop that stupid home button working, so the child just turns off the game and makes phone calls"
To which you have to reply that it's of course not possible because of the way the iPhone works.
So yes it's a good question. As far as I know, Planet, it is not possible.
Apple should add a "kids mode" where parents can lock the fone on TO one particular app for awhile. (Perhaps you would have to long-press or something the home button to unlock it.)
UPDATE
*iOS 6 reportedly has a "Single App Mode" - Check out vpdn's answer below https://stackoverflow.com/a/10503799/333259
This is against the iOS interface guidelines, and apps have been rejected for "overriding" or restricting behaviour of hardware buttons/switches.
I suggest you have a read of the App Store Review Guideline for iOS apps for a good overview of what you shouldn't be doing.
Particularly:
10.5
Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected
Pretty sure that the Home button is included in that.
I'm not sure what your "idea" is here, but I would suggest you look into other things such as backgrounding. There is a feature that allows you to finish executing tasks in the background, even if the user presses the home button, and optionally display a notification after certain time (before the task "expires"). I imagine that this might offer a more appropriate solution (again dependent on what your idea actually is).
In iOS6 (to be released), there's a feature called "Guided Access", which will allow device owners to lock users (like toddlers and school kids) into an app.
Update: Before the shitstorm about NDA content starts, here's where I got the info from: http://www.theverge.com/2012/6/11/3078350/apple-ios-6-guided-access-parental-control
You can't unless you want to run it on jail broken devices.
Apple currently will not allow any software to disable or change ANY button functionality for iPhone, iPad, and iPod touch, so the only software solution is to jailbreak the device, so you're not forced to live by Apple's rules.
However, PaperclipRobot.com is about to release a home button cover specifically targeted to keeping young kids from pressing the home button. Not the exact solution to your problem as stated, but I figured it added to the discussion.
Unsure if you are looking for a way to do it in code in an app or if you're thinking of locking it in general.
Anyways, if you're looking for a way to do it in general, here's a guide for it
http://igrudge.net/how-to-disable-the-home-button-on-ios-devices-iphoneipad/
If you are looking to temporarily disable the home button to keep a child in a particular app, the tip for a make magazine article is to use a bulldog clip to cover the home button cheaper, and more reusable than a bubcap, temporary and effective.
Source: http://blog.makezine.com/2011/03/01/ipad-home-button-child-lock/