screen-brightness icon indicating copy to clipboard operation
screen-brightness copied to clipboard

Back to User configured brightness on iOS

Open JayStolzenwald opened this issue 2 years ago • 3 comments

For Android, the brightness can just be set to -1 to restore the user configured brightness. Would be cool to have the same for iOS

JayStolzenwald avatar Apr 20 '23 13:04 JayStolzenwald

Agreed, if possible 🙂

In my case, I have an app/device that's intended to remain on 24/7 (displays info) and sit in a lounge or kitchen etc.

It needs to:

  • Turn display off (zero brightness) after a period of inactivity
  • Turn display on when required, but let the device determine the brightness (ie revert to the user's adaptive brightness setting)
    • Doesn't blind users at night
    • Is bright enough during the day/when lights are turned on

On Android -1 meets these requirements (I assume - I haven't tried this plugin yet), but for iOS my only option is to hard-code a fixed brightness.

Would be awesome if we could revert back to the user's brightness settings on iOS!

JamieGoodson avatar Jul 05 '23 08:07 JamieGoodson

Is it have the setting for iOS restore the user configured brightness?

ganenghong avatar Oct 30 '23 07:10 ganenghong

I don't think iOS support it the same way as Android does. According to Apple's docs it will reset the brightness to the user's default when the device is locked.

For now I suggest creating a service which listens to the Apps state and when the app comes back to the foreground re-fetch the current brightness and store that in a variable.

App.addListener('appStateChange', async ({ isActive }) => {
    if (isActive) {
        //get current brightness and set to variable
    }
});

I've checked this and when the user changes the brightness of the screen manually, it will trigger the appStateChange cycle.

It would be cool if this could be implemented in the plugin.

Mdemol avatar May 30 '24 11:05 Mdemol