Saltar al contenido

@capgo/capacitor-brightness

Control screen brightness on iOS and Android.

Control screen brightness on iOS and Android.

  • getBrightness - Get the current brightness level of the device’s main screen.
  • setBrightness - Set the brightness level of the device’s main screen.
  • getSystemBrightness - Get the system-wide screen brightness.
  • setSystemBrightness - Set the system-wide screen brightness. Requires WRITE_SETTINGS permission on Android. This also changes the brightness mode to MANUAL.
MethodDescription
getBrightnessGet the current brightness level of the device’s main screen.
setBrightnessSet the brightness level of the device’s main screen.
getSystemBrightnessGet the system-wide screen brightness.
setSystemBrightnessSet the system-wide screen brightness. Requires WRITE_SETTINGS permission on Android. This also changes the brightness mode to MANUAL.
getSystemBrightnessModeGet the current system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android.
setSystemBrightnessModeSet the system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android.
isUsingSystemBrightnessCheck if the current activity is using the system-wide brightness value.
restoreSystemBrightnessReset the brightness setting of the current activity to use the system-wide value.
isAvailableCheck if the Brightness API is available on the current device.
checkPermissionsCheck user’s permissions for accessing system brightness.
requestPermissionsRequest permissions for accessing system brightness. On Android, this opens the system settings to grant WRITE_SETTINGS permission.
getPluginVersionGet the native plugin version.

This reference is synced from src/definitions.ts in capacitor-brightness.