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

App crashes when no approval has been given to use the camera #28

Open
TJ-BitCanna opened this issue Oct 13, 2023 · 10 comments
Open

App crashes when no approval has been given to use the camera #28

TJ-BitCanna opened this issue Oct 13, 2023 · 10 comments

Comments

@TJ-BitCanna
Copy link
Contributor

2023-10-13 13 37 20

To reproduce: just deny the app from being allowed to use the camera :)

@TJ-BitCanna
Copy link
Contributor Author

This only shows on the first time when doing so.

The 2nd attempt just gives a black screen, but no error message of missing access rights.
That needs to be implemented as well.

@TJ-BitCanna
Copy link
Contributor Author

It also crashed to the screen shown when selecting "Only this time"

@atmoner
Copy link
Member

atmoner commented Nov 24, 2023

For your information, this is normal behavior!
The application does not crash, it restarts when the camera authorization is refused. Which is totally normal! Otherwise, it would be an Android security vulnerability.

Simply reconnect and the authorization request for the camera will be requested again.

image

There is nothing to do here

@TJ-BitCanna
Copy link
Contributor Author

Can it adjust just show an error message without going back to the login page?

Something that says "no QR code can be scanned, camera access not given"?
It feels a bit buggy that it goes to the login page.

@atmoner
Copy link
Member

atmoner commented Nov 28, 2023

Ooook!
I added the use of the checkPermissions() function of capacitorJs which Check camera permissions
If the camera is not authorized, there is an error message that appears on the login page and the qrcode scan page.

I haven't tried it on mobile yet, only locally on my PC but it works

To see for the formatting (error text)
image

Fixed here: 447cb31

@TJ-BitCanna
Copy link
Contributor Author

On Android it still goes back to the login page; giving 2 error messages:

  • checkCameraPermissions
  • Session expired

Furthermore; if no camera permissions are set the app already throws an error message "checkCameraPermissions" on the login page. This error is really only needed on the "Scan QR" page, nowhere else.

Also that the app automatically directs to the login page if camera permissions are not given would be better changed. Would be much better if it simply stayed on the "Scan QR" page, but with the error message.

@TJ-BitCanna
Copy link
Contributor Author

Also on iOS when the camera permissions are given the app automatically redirects to the login screen.

Logging in again and going to "scan QR" will then allow scanning.
But the fact that it goes back to the login screen feels buggy and unwanted behaviour.

@atmoner
Copy link
Member

atmoner commented Jan 8, 2024

I added a button to request access to the camera but I cannot test it in the web version so it is possible that it is not completely functional
image
Fix here: 9bc7e4f

@TJ-BitCanna
Copy link
Contributor Author

This was nicely in place, but we are now back at crashing the app.

At this stage even on fresh installs and setting the authorisations for camera use for the first time.
So no changing of authorisations after the first use. This is now already happening on the very first use.

@TJ-BitCanna
Copy link
Contributor Author

Current behaviour:

  • delete app from the phone
  • reinstall
  • set password
  • use password to open the app
  • create a wallet
  • go to "Scan QR"
  • choose the middle option "Only this time"

For me it brings me to the splash screen. And after that even clicking "Scan QR" gives me the splash screen 😅

Still needs a check before we go to the final version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants