Is there a way to send a notification when the power button is pressed for "turn on" or a message to a server if the power button is pressed for "turn off"?
Asked
Active
Viewed 84 times
0
-
See http://stackoverflow.com/questions/23620771/what-privacy-violating-or-device-changing-things-can-i-do-on-an-iphone/23620772#23620772 – danh Sep 10 '14 at 18:24
-
2@danh Your question and answer have absolutely nothing to do with this. A startup/shutdown event arguable exposes nothing more than the hundreds of other events. – The Muffin Man Sep 10 '14 at 18:27
-
1@TheMuffinMan, I disagree. Its private. e.g. Did your battery really die, or were you ignoring my calls? – danh Sep 10 '14 at 18:32
-
This is the type of thing that Apple would generally want to prevent, since it could be used to secretly "track" people. – Hot Licks Sep 10 '14 at 18:51
-
@danh What about "Did you see my app notification or are you ignoring it". How is app going to foreground to background not the same concept? The point you bring up sounds legitimate, but the answer you linked sounds a lot like opinion masquerading as fact – The Muffin Man Sep 10 '14 at 18:53
1 Answers
2
No, this is not possible. You can detect your app is going to background or to foreground and more but not this.

Julian
- 9,299
- 5
- 48
- 65
-
so if i check, and the app is not running in background or foreground, that means the phone is turned off? – dev99 Sep 10 '14 at 18:32
-
2no, it could be the other reason - app never launched but anyway you can operate within your app but there is no way to check it externally whether app is running or not, that would break the user's privacy – Julian Sep 10 '14 at 18:35
-
Krol: Thank you very much for your answers! Do you know if can find that somewhere in Apple documentation? – dev99 Sep 10 '14 at 18:37
-
the prove that this is not possible? I haven't looked for this but I'm pretty sure this is mentioned somewhere there. As a bit off topic I would also mention that you can not detect volume button pressed events (only the effect - volume change) [see my slightly similar question](http://stackoverflow.com/questions/20868192/how-to-distinguish-on-ios-volume-button-clicked-from-setting-it-by-a-software) – Julian Sep 10 '14 at 18:40
-