MobileCRM.Services.DocumentService.capturePhoto - Resconet/JSBridge GitHub Wiki

Asks the user to capture a photo and calls the async callback with file info.

Arguments

Argument Type Description
callback function(MobileCRM.Services.FileInfo) The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallback function(errorMsg) The errorCallback which is called in case of error.
scope Object The scope for callbacks.

This example demonstrates how to capture the photo and place it into <img> element.

var service = new MobileCRM.Services.DocumentService();
service.maxImageSize = "640x480"; // maxImageSize can have one of following values: "Default", "640x480", "1024x768", "1600x1200", "2048x1536", "2592x1936"
service.capturePhoto(function (fileInfo) {
	/// <param name='fileInfo' type='MobileCRM.Services.FileInfo '/>
	if (fileInfo.url)
		testImg.src = fileInfo.url;
}, MobileCRM.bridge.alert);
⚠️ **GitHub.com Fallback** ⚠️