BitCannaGlobal / WeedMobile

5 stars 1 forks source link

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

Open TJ-BitCanna opened 11 months ago

TJ-BitCanna commented 11 months ago

2023-10-13 13 37 20

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

TJ-BitCanna commented 11 months ago

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 commented 11 months ago

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

atmoner commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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: https://github.com/BitCannaGlobal/WeedMobile/commit/447cb31db32fea24d01228b6fb1d7e71ed143233

TJ-BitCanna commented 9 months ago

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

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 commented 9 months ago

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 commented 8 months ago

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: https://github.com/BitCannaGlobal/WeedMobile/commit/9bc7e4f6cd41355983a7e39c0f81b9b071352a31

TJ-BitCanna commented 7 months ago

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 commented 7 months ago

Current behaviour:

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.