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 Only]: refuse camera permissions leads to crashes #78

Open
Gollm opened this issue Jul 7, 2020 · 2 comments
Open

[iOS Only]: refuse camera permissions leads to crashes #78

Gollm opened this issue Jul 7, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Gollm
Copy link

Gollm commented Jul 7, 2020

Describe the bug
When you refuse the permission for camera-usage, the app crashed, when you try to scan.
This is only at ios. Android asks each time for permission and refuse camera-usage, if it have to.
Additionally, it is still possible to scan a document in that moment, you refuse it.

To Reproduce
Steps to reproduce the behavior:

  1. Refuse Camera permissions
  2. Try to scan

Expected behavior
Like Android, ask again for granting permissions and deny, if it have to.

Smartphone (please complete the following information): (Tested ones)

  • Device: [ iPhone6, iPhone 7]
  • OS: [iOS 12.4.4, iOS 13.5.1]
  • Version [4.2.5]
  • Cordova Version [9.0.0]
  • Cordova Platform [ios]
  • Cordova Platform Version [5.1.1]

Additional context
Xcode Crash Error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureSession addInput:] Can't add a nil AVCaptureInput'

@ChrisTomAlx ChrisTomAlx self-assigned this Jul 9, 2020
@ChrisTomAlx ChrisTomAlx added the bug Something isn't working label Jul 9, 2020
@ChrisTomAlx
Copy link
Collaborator

Hey @Gollm

Thanks for raising this issue. By default iOS won't let you ask the user again for permission. Its a one time thing. If the user denies permission, they will have to manually go in to settings and change the permission.

But you are right the scan shouldn't start if the permission was denied. I am not sure when I will be able to take a look at this issue but for now as a workaround you could use the diagnostic cordova plugin to request for permission and then once user has given permission run the scan command

Cheers and have a nice day :)
Chris
Neutrinos

@Gollm
Copy link
Author

Gollm commented Jul 9, 2020

Thank you for your very fast response! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants