gluonhq / attach

GNU General Public License v3.0
48 stars 26 forks source link

Add Support to ask if Camera is available #370

Open LordTylus opened 11 months ago

LordTylus commented 11 months ago

Hello there,

our mobile app has a function, where the User has to scan a qr code as means of Authentifikation. Since EVERY iOS and Android device nowadays has a camera available this is no problem.

But on Desktop or in the iOS simulator I have no access to a camera or there is just none available. When i use the BarcodeService on Simulator things dont function at all (for obvious reasons), and my only workaround right now is to ask the Platform if isDesktop() returns true.

This works well for the Desktop. But Sadly not for the simulator. So, it would be amazing, if I either could ask a DeviceService for example if and how many Cameras are available. Or if I could figure out that I am on Simulator any other way. Similarily, it would also be very nice, if I could easily check, if I have camera permissions. Because if the user didn't grant that, I want to offer him the alternative as well.