Accessing the iPad's cameras within Kiosk Pro

Our JavaScript API is how we generally recommend accessing the camera as it gives you the most control over the visitor's experience, but depending on where your content is hosted and what you are trying to accomplish, it's not always a viable option.

To go into a bit more depth, the JavaScript API saves photos locally on the device in the Kiosk Pro documents folder. For security and privacy, Apple does not allow online websites to request locally stored assets on iOS - specifically, you wouldn't want just any website to be able to scan through and look at files you have on your device as those files could potentially contain sensitive information. This means that to access images taken through the camera, your Kiosk Pro content must also be stored locally in Kiosk Pro's documents folder. 

If your content is hosted online and you need some way of accessing the image file after it is taken, your only option is the HTML 5 Media Capture API, which uses an input field to trigger the camera:

<input type="file" accept="image/*">

This input triggers a pop-up next to the field, allowing the user to select whether to 'Open Camera', 'Add from Gallery' or 'Add from iCloud'. Since support for this API is a part of the underlying iOS browser components that Kiosk Pro is based on (and not specifically part of our app like our JavaScript APIs), we don't have direct control over how this is implemented.

When the visitor selects 'Open Camera', there is no way to specify which camera is to be used and, in our testing, the iPad generally defaulted to the back camera and had to be flipped to the front camera (more frequently used in this type of kiosk use) using the button on screen. 

You can block access to the photo gallery by enabling Restrictions on the device. The option to select from the gallery is still shown, but when selected shows a message that the app does not have permission to access the gallery. To enable this:

  1. Open iOS settings
  2. Select General in the sidebar
  3. Select Restrictions
  4. Select Enable Restrictions
  5. Under Privacy, select Photos
  6. Select Don't Allow Changes.

If the device is signed in to iCloud (as it generally is by default following an update of the iOS operating system), the option to 'Add from iCloud' will also be shown. So far in our testing, signing out of iCloud on the device removes this option.

This means that when using the HTML 5 Media Capture API there is no way to pick the device's front camera by default or to prevent the 'Add from Gallery' option and select which camera to use.

Still stuck? How can we help? How can we help?