Any way to check if the device is plugged in?

Any way to detect if the device is plugged in or not?

I need to add a warning if it’s not.
[import]uid: 8192 topic_id: 7587 reply_id: 307587[/import]

Please clarify?

Plugged in on computer, iTunes?

What do you want to achieve? Objective? [import]uid: 8576 topic_id: 7587 reply_id: 26917[/import]

To any power supply. Is it charging?

Need to put a warning to plug the device in if it’s not.
[import]uid: 8192 topic_id: 7587 reply_id: 26926[/import]

Anyone else? I am unsure if this can be done [import]uid: 8576 topic_id: 7587 reply_id: 26934[/import]