power on events in iphone

2019-02-19 19:20发布

I want to know whether we can get power off or on events in iphone. In other platforms like Android, BREW we will get a notification to our app saying the phone is turned ON. Is it possible in iphone?

Thanks Jithendra

标签: iphone ios
1条回答
地球回转人心会变
2楼-- · 2019-02-19 19:27

Short answer: no.

Your app isn't running on power-on, so there's nothing to notify. (A special case here would be apps registered as VoIP clients. But you still can't tell whether the handset just started or whether your app was killed for some other reason and then restarted.)

And when iOS shuts down it will send KILL signals to any background running tasks. You can't intercept them, so that doesn't really help you. (And even if you could, again, it doesn't say why your app is being killed.)

查看更多
登录 后发表回答