Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back to User configured brightness on iOS #11

Open
JayStolzenwald opened this issue Apr 20, 2023 · 3 comments
Open

Back to User configured brightness on iOS #11

JayStolzenwald opened this issue Apr 20, 2023 · 3 comments

Comments

@JayStolzenwald
Copy link

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

@JamieGoodson
Copy link

JamieGoodson commented Jul 5, 2023

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!

@ganenghong
Copy link

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

@Mdemol
Copy link

Mdemol commented May 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants