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
Post a Comment