Is there anyway to put the iPhone into sleep mode from an app?
If yes, how can I do that?
Thanks,
Tee
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not in a public API. There may be something private but you wouldn’t be able to use it in the app store. The only method I know of that deals with the sleep mode is being able to disable the sleep while your application is running:
I think the idea is that software shouldn’t be able to effect the hardware too much i.e. starting, sleeping quitting your application are not up to you and exit()ing your app manually through code would be a non-standard practice and frowned upon by Apple. The nice thing is that your phone will sleep by default after a short amount of time.