iOS Question How to find if LLCamera permission has been given or not asked for yet

JackKirk

Well-Known Member
Licensed User
Longtime User
B4X:
 Public Obj_camera As LLCamera
 wrk_bool = Obj_camera.AuthorizationDenied

This will tell me if authorization has been denied or not

if wrk_bool = True ---- authorization has been denied

if wk_bool = False ---- authorization has NOT been denied ---- but this can mean
authorization has been given
-or-
authorization has not been asked for yet

How do I determine which of these states apply?

I want to know this so I can selectively put up a message to the user that he is about to be asked for permission - before an attempt to initialize the camera is made.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
' AVAuthorizationStatusNotDetermined = 0,
' AVAuthorizationStatusRestricted    = 1
' AVAuthorizationStatusDenied        = 2
' AVAuthorizationStatusAuthorized    = 3
Private Sub GetAVAuthorizationStatus As Int
    Dim no As NativeObject
    Return no.Initialize("AVCaptureDevice").RunMethod("authorizationStatusForMediaType:", Array("vide")).AsNumber
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…