iosuidevice

Is There A Way to Get Notifications When Ambient Light Changes?


OK. I have an app that is designed to allow the user to reduce the screen brightness manually. It works great. I use the standard UIScreen calls to do that, in response to a slider.

I'd like to be able to leverage the ambient light sensor, if possible, but it seems that it is not.

All the feedback that I've seen so far, is that Apple locks up access to the sensor via a private API (meaning no can release apps that use).

I'm wondering if there are any other ways to detect the ambient light level without going directly to the sensor.

I'm thinking of things like key/value binding or notification manager stuff.

I have not seen this kind of thing for ambient light anywhere. I am about to throw in the towel, but figured I'd ask around here, just for the heck of it.

Does anyone know of some (legal) way to find out what the phone believes is the ambient light?


Solution

  • I don't believe that exits some API to ambient light. But what do you think to try get this information by phone's camera ?.

    I found this great answer when i was looking for luximenter api for iOS.

    https://stackoverflow.com/a/10744323/6273003