Camera Methods

Camera has the following methods associated with it.

To use the openCamera and takePicture methods of Camera Widget, your app needs runtime permission from the end-user (to open the camera and take photos). If you call any API without obtaining the permission, platforms automatically pops up a system permission dialog box with "Allow" and "Deny" options, asking the end-user to grant permission to use the device's camera. This is applicable only for Android and iOS platforms.

If the end-user taps the "Allow" option, platform proceeds to access the underlying OS API. If the end-user taps the "Deny" option, the errorcallback in invoked with the kony.application.PERMISSION_DENIED error code.

NOTE: The runtime permissions are applicable only in the iOS and Android platforms.

Example

//Error callback when the permission is denied.
function cameraErrorCallback(camera, errCode) { if (errCode == kony.application.PERMISSION_DENIED) { alert("Permission Denied to Access the Camera"); } }