Parameters
Code Example
Related APIs
my.getScreenBrightness
Get current brightness
my.setScreenBrightness
Set brightness level
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Prevent the screen from turning off while the Mini App is running.
| Property | Type | Required | Description |
|---|---|---|---|
| keepScreenOn | Boolean | Yes | true keeps screen on, false restores default behavior |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
// Keep screen on (e.g. during a QR code display or navigation view)
my.setKeepScreenOn({
keepScreenOn: true,
success: () => {
console.log('Screen will stay on');
}
});
// Restore default behavior
my.setKeepScreenOn({
keepScreenOn: false,
});