简体   繁体   中英

Is there any way to retrieve display brightness and light sensor value of iPhone?

Is there any way to retrieve display brightness and light sensor value of iPhone?

Suppose i have a jailbroken iPhone. Either command line of ssh or object-C code are acceptable.

Located in private BackBoardServices.framework:

float BKSDisplayBrightnessGetCurrent();

As for light sensor, couldn't find any methods to retrieve it's value. There're only three methods: check for existance of the sensor, enable/disable auto-brightness.

A common workaround for getting an approximation of the light sensor value is through:

NSLog(@"Screen Brightness: %f",[[UIScreen mainScreen] brightness]);

But there is no API to access the ambient light sensor directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM