Skip to content

iOS: Strange behavior of #takePicture #51

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

Closed
Pinny3 opened this issue Aug 19, 2017 · 2 comments
Closed

iOS: Strange behavior of #takePicture #51

Pinny3 opened this issue Aug 19, 2017 · 2 comments

Comments

@Pinny3
Copy link

Pinny3 commented Aug 19, 2017

Hi there,

somehow the functionality

camera.takePicture(...)

is a little bit strange on iOS 10.3

I use the example project provided here:

https://github.com/NativeScript/nativescript-camera/tree/master/examples/CameraTestAngular

When I call the functionality to take a picture in the in my app the camera comes up. Then I been prompted to allow the app to use the camera. If I denied it I still can make a photo and it's totally blacked and the photo is displayed. This is somehow strange, isn't it? Why isn't the camera closed then?

Even if I click the second time on "Take Picture" the camera comes up again allowing me to take a complete black photo...

I expect the camera to been closed once I don't allow the app to take a photo and the camera does not comes up again if I revoke the right before.

@Pinny3 Pinny3 changed the title iOS: iOS: Strange behavior of #takePicture Aug 19, 2017
@tsonevn
Copy link
Contributor

tsonevn commented Aug 23, 2017

Hi @Pinny3,
Thank you for reporting this issue,
I reviewed it on my side and was able to reproduce the same behavior while using the non-Angular sample app.

For further info and a solution please keep track on the issue.

DimitarTachev pushed a commit that referenced this issue Dec 6, 2017
…sions-ios

Request camera permission before opening the camera. Fix issue #51.
@DimitarTachev
Copy link

Hi @Pinny3,

We were relying on the camera itself to request the permission on iOS and the rejection wasn't handled properly there.

The requestPermissions method is now requesting the Camera permissions and you can easily avoid the problematic behavior by calling the takePicture method only when the requestPermissions promise is resoled. The fix is part of the 3.2.1 release of the plugin.

@ghost ghost removed the bug label Dec 6, 2017
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

3 participants