How to know when system goes to sleep mode or awakes

How to know when system goes to sleep mode or awakes

BY 03 May 2017 Native Application Development

Hello,

I’m developping a native service, no UI, and I’d like to know when the system goes to sleep mode, e.g. my service will be put to sleep, and when the system awakes, e.g. when the system awakes my service.

I did not find anything in the doc, is there some kond of callback function that is called when the system goes to sleep or awakes (like onPause and onResume on Android for example)? Or is there any other to catch such events?

Thanks.

Written by