Android Question runtime permission for Camera using PERMISSION_CAMERA only returns true after not allowing use when 1st asked

Markos

Active Member
Licensed User
Longtime User
rp.Check(rp.PERMISSION_CAMERA) only returns true if 1st run permission is not allowed and when relaunch the app it never shows the dialog using the rp.CheckAndRequest(rp.PERMISSION_CAMERA) to ask the use again to get permission

Request Camera Use:
Dim Result As Boolean
    dim rp As RuntimePermissions

    If Not(rp.Check(rp.PERMISSION_CAMERA))  Then 'only returns true after checking a 2nd time after not allowing use
        rp.CheckAndRequest(rp.PERMISSION_CAMERA)
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    End If
 
Last edited:

Markos

Active Member
Licensed User
Longtime User
It seems to only remember the not allowing from the 1st request and will not ever produce the dialogue to ask the user for permission I'm using

uses-sdk android:minSdkVersion="13" android:compileSdkVersion="33" android:targetSdkVersion="33"

I tried an original example fromhttps://www.b4x.com/android/forum/t...e-camera-library-functionality.23801/#content and it behaves the same way after 1st disallow and after relaunching the app it never asks the user again for permission it just assumes no permission granted and does not show the request dialog again. The only way to solve is to uninstall and reinstall but that is not cool
 
Last edited:
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
You should always use CheckandRequest without the previous Check only.
Did you tried in this way?
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
You should always use CheckandRequest without the previous Check only.
Did you tried in this way?
Hi,

Yes I removed the check and just used checkandrequest and it behaves the same way to not showing the dialog ever again after not allowing camera access the 1st time
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the system is designed to ask the first time the app is launched. if, later on, you change your mind
regarding the app's permissions, you change them in the system's settings tab for the app. you don't
have to uninstall and reinstall the app. the alternative - forcing the user to grant or deny permissions
every time the app is launched - was not implemented (an app may require access to more than 1
feature). this would prove very annoying very quickly if i wanted to take a photo but had to answer
questions relating to camera, gps, phone, photos, contacts, etc every time i launched the app. ask
me once, and if i want to change something later, i can change a particular permission in the app's
settings. it is the developer's job to inform the user regarding an app's permissions and how to manage
them. this is covered in google's documentation relating to runtime permissions.
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
the system is designed to ask the first time the app is launched. if, later on, you change your mind
regarding the app's permissions, you change them in the system's settings tab for the app. you don't
have to uninstall and reinstall the app. the alternative - forcing the user to grant or deny permissions
every time the app is launched - was not implemented (an app may require access to more than 1
feature). this would prove very annoying very quickly if i wanted to take a photo but had to answer
questions relating to camera, gps, phone, photos, contacts, etc every time i launched the app. ask
me once, and if i want to change something later, i can change a particular permission in the app's
settings. it is the developer's job to inform the user regarding an app's permissions and how to manage
them. this is covered in google's documentation relating to runtime permissions.
Ok Kool, then once it is not a hiccup then I will just have a message so the user can take necessary steps to allow access to use the app.

Thanks!
 
Upvote 0
Top