Skip to main content
Control whether the device screen stays on while the Mini App is active. Only affects the current Mini App instance — screen behavior returns to normal when the user exits.

Parameters

PropertyTypeRequiredDescription
keepScreenOnBooleanYestrue keeps screen on, false restores default behavior
successFunctionNoCallback on success
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Code Example

// 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,
});

my.getScreenBrightness

Get current brightness

my.setScreenBrightness

Set brightness level