Hey there
I’m finding that checking for camera permissions is problematic lately.
juce::RuntimePermissions::request(juce::RuntimePermissions::camera, [this] (bool wasGranted)
{
if (wasGranted)
DBG("granted");
else
DBG("not granted");
});
…always returns true, whether or not camera permissions are actually allowed. So I can’t halt the proceedings with this check.
*EDIT: looking at the docs it says “some platforms”, but perhaps this is specifically for use with Android, not iOS as well.
Further, per the CameraDemo example project, using openCameraAsync with a callback function such as:
void cameraDeviceOpenResult (CameraDevice* device, const String& error)
{
// If camera opening worked, create a preview component for it..
cameraDevice.reset (device);
if (cameraDevice.get() != nullptr)
… also doesn’t help as even if the permissions were not granted, CameraDevice won’t necessarily be a nullptr as is (I believe) implied by the demo code. So again I can’t detect this problem via these means either. In fact, the demo code crashes for me if I say “no” to permissions and continue with the app.
So what are you cool cats doing when you handle this, that I’m clearly not comprehending yet?
Many thanks, Jeff