Permission problem?

Hello.
I built my app on Android 9 and everything worked fine. One of the functions was to scan a QR code. When someone with Android 11 wanted to use the app, a message appeared saying that permission for the camera had not been granted. Searching the forum I found out how permissions should be requested and I tried to do the same. When compiling with AI Companion (on my Android 9) the QR scan button is no longer enabled, but if I do a DO IT on the permission request (which is in Screen1.Initialize) it enables me to use it. I generated the APK, but the problem persists. In the .PermissionGranted event I tried both options: with and without the conditional for the requested permission, but in neither case did I have better luck. Is it an AI problem or did I do something wrong?

PermisoCamara

There can be only one PermissionGranted event in the screen..
Also that event only fires after you granted the permission... next time you open the app, the permission already is granted, the event does not fire again... therefore your button remains disabled

Use TinyDB to store, if the permission has been granted...

Taifun

1 Like

So you're claiming that CAMERA permission is automatically requested on Android 9, but not on Android 11. Correct? If so, show the blocks where the camera is called.

Thanks for your comment. I will try it an see what happens

What I am saying is that in my Android 9 I had never had the need to ask for permission and it worked fine. The only time the camera is called is with the barcode DoScan caller. Apparently, there is a need to ask for permission for Android 11, so when I tried to ask for it, it stopped working (in my phone). I will try Taifun's suggestion and see what happens.

So again: You do not need to ask for CAMERA permission on Android 9, but on Android 11? Correct?

thats correct

Ok, I would like to check this. Please post the aia or a test aia (or post it to me via PM).

I've no problem with that on Android 11.