@capgo/capacitor-brightness
Control screen brightness on iOS and Android.
Overview
Section titled “Overview”Control screen brightness on iOS and Android.
Core Capabilities
Section titled “Core Capabilities”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.
Public API
Section titled “Public API”| Method | Description |
|---|---|
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. |
getSystemBrightnessMode | Get the current system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android. |
setSystemBrightnessMode | Set the system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android. |
isUsingSystemBrightness | Check if the current activity is using the system-wide brightness value. |
restoreSystemBrightness | Reset the brightness setting of the current activity to use the system-wide value. |
isAvailable | Check if the Brightness API is available on the current device. |
checkPermissions | Check user’s permissions for accessing system brightness. |
requestPermissions | Request permissions for accessing system brightness. On Android, this opens the system settings to grant WRITE_SETTINGS permission. |
getPluginVersion | Get the native plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-brightness.