Skip to content

@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.

Keep going from @capgo/capacitor-brightness

Section titled “Keep going from @capgo/capacitor-brightness”

If you are using @capgo/capacitor-brightness to plan native media and interface behavior, connect it with Using @capgo/capacitor-brightness for the native capability in Using @capgo/capacitor-brightness, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.