-
-
Notifications
You must be signed in to change notification settings - Fork 226
Add in light sensor for Android #464
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
base: master
Are you sure you want to change the base?
Add in light sensor for Android #464
Conversation
This seems to be Android only, for react native sensors we want to build a common interface for sensors across all platforms. We would need to add an iOS implementation if it exists. Otherwise I would suggest making this our own project, I'm happy to add a link to it in our Readme / Docs. |
@DanielMSchmidt iOS does not have a direct equivalent to Android's Sensor.TYPE_LIGHT for ambient light detection, and there is no public API to access the ambient light sensor directly. Therefore, setting this up for iOS is challenging. However, we can achieve similar functionality on iOS using the UIScreen class, which provides the screen brightness. Although it doesn't measure ambient light directly, it can offer some insight into the room's brightness. This method works best if the device's auto-brightness feature is enabled, allowing us to infer environmental lighting changes. Let me know your thought on this. Thanks, Fahad |
I'd encourage you to make it a separate library. I know there is some demand for this since we get PRs like this once in a while, but I would like this library to be both very low level and universal across all platforms we support. We could add this library to the react-native sensor org and use a similar API like the one for this project if you like :) |
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Co-authored-by: Brendan O'Brien <titaniumcranium@icloud.com>
Hey @fahadhaque007 Can you use SRAmbientLightSensor for the iOS side ? Let me know if you will be working on this |
We aim to integrate a sensor for ambient light capture on Android devices. This PR will enable us to detect the availability of the sensor on the device and allow users to capture and record the lux levels in their environment. Additionally, we have added the following functions:
@DanielMSchmidt we would appreciate your feedback on incorporating this into your codebase.