Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-06-2009, 02:38 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 23
tmeehan is on a distinguished road
Default Detecting when user presses sleep/wake button

Does anyone know if there is a way to detect or be notified when the user physically presses the sleep/wake button. I would like to take some power saving steps if I know the user specifically pressed the sleep button as opposed to the idle timer kicking in. Any clues would help tremendously. Thanks.
tmeehan is offline   Reply With Quote
Old 11-06-2009, 07:35 PM   #2 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

Check out
Code:
-(void)applicationWillResignActive:(UIApplication *)UIApplicationWillResignActiveNotification{
}
in the developer documentation.
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 11-10-2009, 10:02 AM   #3 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 23
tmeehan is on a distinguished road
Default Detecting user initiated sleep

Quote:
Originally Posted by ansonl View Post
Check out
Code:
-(void)applicationWillResignActive:(UIApplication *)UIApplicationWillResignActiveNotification{
}
in the developer documentation.
Thanks for the lead. It appears, however, that I get the same notification whether the system initiates the sleep or the user presses the sleep/lock button on the phone. I need to find a way to differentiate between the two. Any ideas?
tmeehan is offline   Reply With Quote
Old 06-09-2010, 05:30 AM   #4 (permalink)
Registered Member
 
Join Date: Oct 2008
Location: London, UK
Posts: 250
mattjgalloway is on a distinguished road
Default

Quote:
Originally Posted by tmeehan View Post
Thanks for the lead. It appears, however, that I get the same notification whether the system initiates the sleep or the user presses the sleep/lock button on the phone. I need to find a way to differentiate between the two. Any ideas?
Did you find an answer to this?
__________________
Beard Booth HD - See what you'd look like with a beard today!

My iPhone Apps
My iPhone Tutorials
mattjgalloway is offline   Reply With Quote
Old 07-08-2010, 02:37 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 1
Paratus is on a distinguished road
Default

Quote:
Originally Posted by tmeehan View Post
Thanks for the lead. It appears, however, that I get the same notification whether the system initiates the sleep or the user presses the sleep/lock button on the phone. I need to find a way to differentiate between the two. Any ideas?
Hi tmeehan,
any news on this? I'm especially interested in knowing, if it is possible to get the notification as well, if system is in SLEEP mode and you push the sleep/lock button. Any experience on this?

Cheers
Paratus is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 343
11 members and 332 guests
alexP, ClerurcifeDer, Duncan C, givensur, glenn_sayers, guusleijsten, JmayLive, NetGuru, Punkjumper, whitey99, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:41 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0