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

iOS Flashlight Intensity #3

Open
bluetidepro opened this issue Oct 8, 2016 · 1 comment
Open

iOS Flashlight Intensity #3

bluetidepro opened this issue Oct 8, 2016 · 1 comment

Comments

@bluetidepro
Copy link

First off, thank you so much for making this wrapper! This seems to be the only wrapper for React Native and the iOS flashlight! :)

My question/request:

Would it be possible to build in an intensity value with this wrapper that can be passed in optionally? I'm not 100% sure about Android, but I know iOS supports setting an intensity value with the flashlight, it would be amazing if you could build this into this wrapper (even if it only actually worked on iOS).

Some resources that may help with how this could be done?

I'd be happy to add this feature in and PR it into this repo if you could maybe point me in the right direction on how to do this, if you don't have time (which I totally understand)!

Thanks so much, hope this is something that can be added with not too much effort!

@rhaker
Copy link
Owner

rhaker commented Oct 9, 2016

It's possible. The basic steps seem to be:

  1. include an intensity value in javascript that would get sent over the react native bridge
  2. modify the RNControlFlashlight.m to include the intensity value (performing validation)
  3. use the setTorchModeOnWithLevel instead of setTorchMode in RNControlFlashlight.m

Give it a shot and see if you can get it to work. I don't know when I'll have time to update it myself...And let me know if you get stuck.

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

2 participants