locking - Detect when iOS device wakes up from sleep -


is there anyway can detect when device wakes up? sleep mean device screen off, , wakes mean when device's screen on or when lock screen showed (when home or power button pressed). thanks!

you can detect when app stops being active application with:

- (void)applicationdidenterbackground:(uiapplication *)application 

in app delegate.

also, can detect when comes view with:

- (void)applicationdidbecomeactive:(uiapplication *)application 

there isn't way detect device locked vs detecting if user switched app app. can know user leaving app , can know when they've returned app.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -