Hi,
I’m using the BarcodeScanner from iBarcode2 library kindly provided by JanPRO in this post to process QR codes and images taken while scanning the codes.
I need to check for granted camera permission before scanning. I tried by calling this class method in MTBBarcodeScanner class:
My idea was using native objects but I failed due to my missing OBJC skills:
I receive this exception: Method not found: requestCameraPermissionWithSuccess:, target: <MTBBarcodeScanner: 0x281575800>
Could someone please help me with a solution and give my an explanation what I was doing wrong?
Thanks,
Thomas
I’m using the BarcodeScanner from iBarcode2 library kindly provided by JanPRO in this post to process QR codes and images taken while scanning the codes.
I need to check for granted camera permission before scanning. I tried by calling this class method in MTBBarcodeScanner class:
Objective-C:
+ (void)requestCameraPermissionWithSuccess:(void (^)(BOOL success))successBlock { … }
My idea was using native objects but I failed due to my missing OBJC skills:
B4X:
Private Sub requestCameraPermission(bcs As BarcodeScanner) As Boolean
Dim bolGranted As Boolean
Dim no As NativeObject = bcs
Dim bl As NativeObject
Try
bolGranted = no.GetField("scanner").RunMethodWithBlocks("requestCameraPermissionWithSuccess:", Array(bl.CreateBlock("successBlock", 0, True)))
Log(bolGranted)
Catch
Log(LastException.Message)
End Try
Return bolGranted
End Sub
I receive this exception: Method not found: requestCameraPermissionWithSuccess:, target: <MTBBarcodeScanner: 0x281575800>
Could someone please help me with a solution and give my an explanation what I was doing wrong?
Thanks,
Thomas
Last edited: