I'm using this API to set the brightness of the screen in my app(Unity3D/ObjC plugin)
[UIScreen mainScreen].brightness = myBrightness;
When I push the home button, the brightness is never restored, as the documentation explicitly states it should be:
The system restores the user-supplied brightness setting at appropriate times when your app is not in the foreground. So if you change the value of this property, you do not need to record the previous value and restore it when your app moves to the background.
I'm also using this Unity3D API to make sure the screen doesn't go to sleep, but instead just dims when I tell it to:
Screen.sleepTimeout = SleepTimeout.NeverSleep;
Why does the brightness not reset?
note: I mention Unity3D because I'm wondering if Unity could be causing this problem. Is there anything Unity could be doing that would prevent the brightness from resetting?