01-06-2013 12:00 AM
I would like to notify the user that the camera is unavailable until they turn on the camera permission. However, the only permissions I can find in the API is under BBM, and isn't related.
How do I find this out?
Solved! Go to Solution.
01-06-2013 02:47 AM
Have you tried checking the allCamerasAccessible flag: https://developer.blackberry.com/cascades/referenc
01-06-2013 06:48 PM
allCamerasAccessible may not do exactly what you want.
It may tell you that cameras are inaccessible because they are already in use by another app.
I think you ultimately want to call into authman some how to determine if you have the permission or not.
I'll have to check on this.
camera_get_supported_cameras() is one native API you could try using.
This function calls eaccess() to determine if your app has access to the camera devices.
If you invoke it as:
unsigned int num=0; camera_get_supported_cameras(0, &num, NULL);
Then num should contain the # of camera devices accessible. If this # is 0, then it's safe to assume your app doesn't have permission. Either that or you are running on a device which has no cameras