Expo

Documentation

Hi friend! Meet us at App.js Conf in Krakow, Poland on April 4th and 5th with workshops and talks. Learn more

Brightness

An API to get and set screen brightness.

Sets screen brightness.

  • brightnessValue (number) -- A number between 0 and 1, representing the desired screen brightness.

Gets screen brightness.

A Promise that is resolved with a number between 0 and 1, representing the current screen brightness.

WARNING: this method is experimental.
Sets global system screen brightness, requires WRITE_SETTINGS permissions on Android.

  • brightnessValue (number) -- A number between 0 and 1, representing the desired screen brightness.

await Permissions.askAsync(Permissions.SYSTEM_BRIGHTNESS);

const { status } = await Permissions.getAsync(Permissions.SYSTEM_BRIGHTNESS);
if (status === 'granted') {
  Expo.Brightness.setSystemBrightness(100);
}
...

WARNING: this method is experimental.
Gets global system screen brightness.

A Promise that is resolved with a number between 0 and 1, representing the current system screen brightness.