The APIs on this page will only work with SDK 4.9+.
Notifies your app when the backlight turns on or off.
The BacklightService lets your app react to the backlight turning on. The handler is invoked whenever the backlight transitions between off and on (any non-off state — fully on, on with timeout, or fading out is treated as "on"). This means you get a single edge per wake, not one event per fade step.
Subscribe to the backlight event service. Once subscribed, the handler is called every time the backlight transitions between off and on.
A callback to be executed on backlight on/off events.
Unsubscribe from the backlight event service. Once unsubscribed, the previously registered handler will no longer be called.
To read the current backlight state at any time, use light_is_on().
Callback type for backlight on/off events.
true when the backlight has just turned on, false when it has just turned fully off.
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can join us on the Discord!