Class: SelfieCaptureExperience

SelfieCaptureExperience()

new SelfieCaptureExperience()

Methods

addImageCapturedListener(successCallback, errorCallback, imageCaptureCallback)

A listener that will be called when an image was captured. This will only be sent after the experience receives a takePicture message. The experience will wait until the desired minimumFaceSize, faceAngleTolerance and camera adjustments are met and then capture an image. It would then send the imageObject of the captured image to success call back method. Add this event listener before calling the 'takePicture' method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
imageCaptureCallback function A JSON object containing the properties of the captured image object. Check the 'Image' object for its properties.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function imageCaptureCallback(image){
      alert(image.imageObject);
}
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var selfieCaptureExperience = kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
selfieCaptureExperience.addImageCapturedListener(successCallback, errorCallback, imageCaptureCallback);

bindCaptureControl(successCallback:, errorCallback:, imageCaptureControlID)

Method to bind the created ImageCapture Control with the SelfieCaptureExperience class .
Parameters:
Name Type Description
successCallback: function Default Success call back function name
errorCallback: function Default Error call back function name
imageCaptureControlID String : Pass the ID retrieved for the Image Capture Control If a wrong ID is passed an error is received in the error callback
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});
selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);

bindCaptureControlWithOptions(successCallback:, errorCallback:, options)

Method to bind the created ImageCapture Control with the SelfieCaptureExperience class and also to set options. This method is a combination of bindCaptureControl API and setOptions API.
Parameters:
Name Type Description
successCallback: function Default Success call back function name
errorCallback: function Default Error call back function name
options Object : A JSON object containing the ID retrieved for the Image Capture Control and the properties to be set to the SelfieCaptureExperience. If a wrong ID is passed an error is received in the error callback
Properties
Name Type Attributes Description
ImageCaptureControlID String <optional>
: Pass the ID retrieved for the Image Capture Control. If a wrong ID is passed an error is received in the error callback
CaptureExperienceOptions Object <optional>
: a 'selfieCaptureExperienceOptions' variable containing the properties to be set to the SelfieCaptureExperience
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;
var selfieCaptureExperienceOptions = null;
selfieCaptureExperience.getOptions(function(success){selfieCaptureExperienceOptions = success},function(error){alert(JSON.stringify(error));});
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});
selfieCaptureExperience.bindCaptureControlWithOptions(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},{"ImageCaptureControlID":imageCaptureControlId,"CaptureExperienceOptions":selfieCaptureExperienceOptions});

destroy(successCallback, errorCallback)

Method to clear SelfieCaptureExperience memory.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function errorCallback(error){
      alert(JSON.stringify(error));
}
function successCallback(options){
      alert(JSON.stringify(options));
      // Optionally you can get the properties and map to the application UI to show the user
}

var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;


imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});



selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);
selfieCaptureExperience.takePicture(successCallback,errorCallback);
selfieCaptureExperience.destroy(successCallback,errorCallback);

getOptions(successCallback, errorCallback)

Method to get the properties of the native SelfieCaptureExperience class.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function errorCallback(error){
      alert(JSON.stringify(error));
}
function successCallback(options){
      alert(JSON.stringify(options));
      // Optionally you can get the properties and map to the application UI to show the user
}

var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;


imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});



selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);



selfieCaptureExperience.getOptions(successCallback,errorCallback);

getSelfieCaptureOptions()

Method returning the 'SelfieCaptureExperience' class properties that can be set by the user. Use this object as an input parameter to set the properties of the SelfieCaptureExperience class. The parameters are grouped, and has the below mentioned default values.
Example
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
 var selfieCaptureExperienceProperties = selfieCaptureExperience.getSelfieCaptureOptions();
 selfieCaptureExperienceProperties should be like below{
       LookAndFeel: {          
           outerViewFinderColor : "#FFFFFF",
           vibrationEnabled : true,
           guidanceFrameColor : "#000000"
       },
       CaptureCriteria: {
           	SelfieDetectionSettings:{
                   centerPoint:{
                       x: 0,
                       y: 0
                   },
                   aspectRatio: 0,
                   padding: 10.0,
                   minimumFaceSize: 0.25,
                   faceAngleTolerance: 15
              }
           
       },
       UserInstructionMessage: {
           backgroundColor: "#00000000",
           textColor: "#FF0000",
           message: "Center Face",
           visible: true,
              orientation: "PORTRAIT",
           fontAndroid: {
             textSize : -1
          },
          fontiOS:{
             fontSize : -1,
             fontName : "HelveticaNeue"
           },
           position :{
              x : -1,
              y : -1
           },
           size:{
              width: -1,
              height: -1
           }
       },
       
       CapturedMessage: {
           backgroundColor: "#B2000000",
           textColor: "#00F900",
           message: "Done!",
           visible: true,
              orientation: "PORTRAIT",
           fontAndroid: {
             textSize : -1
          },
          fontiOS:{
             fontSize : -1,
             fontName : "HelveticaNeue"
           },
           position :{
              x : -1,
              y : -1
           },
           size:{
              width: -1,
              height: -1
           }
       },
       HoldSteadyMessage: {
           backgroundColor: "#00FFFFFF",
           textColor: "#FFFFFFFF",
           message: "Hold Steady",
           visible: true,
              orientation: "PORTRAIT",
           fontAndroid: {
             textSize : -1
          },
           position :{
              x : -1,
              y : -1
           },
           size:{
              width: -1,
              height: -1
           }
       },
		 EyesBlinkInstructionMessage: {
           backgroundColor: "#00000000",
           textColor: "#FF0000",
           message: "Blink now",
           visible: true,
              orientation: "PORTRAIT",
           fontAndroid: {
             textSize : -1
          },
          fontiOS:{
             fontSize : -1,
             fontName : "HelveticaNeue"
           },
           position :{
              x : -1,
              y : -1
           },
           size:{
              width: -1,
              height: -1
           }
       }
       
   };

removeImageCapturedListener(successCallback, errorCallback)

The method would remove the listener to the delegate call back of the takePicture method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function successCallback(response){
  alert(JSON.stringify(response));
}
function errorCallback(error){
  alert(JSON.stringify(error));
}
var selfieCaptureExperience = kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
//after taking picture
selfieCaptureExperience.removeImageCapturedListener(successCallback,errorCallback);

setOptions(successCallback, errorCallback, options)

Method to set the properties of the native SelfieCaptureExperience class.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
options Object a 'selfieCaptureExperienceOptions' variable containing the properties to be set to the SelfieCaptureExperience
Properties
Name Type Description
LookAndFeel Object Look and Feel options
Properties
Name Type Attributes Default Description
outerViewFinderColor String <optional>
"#FFFFFF" This value specifies the outer view finder color
vibrationEnabled Boolean <optional>
true This value specifies the device vibration is enable or not when image capture happens
guidanceFrameColor Boolean <optional>
"#000000" This value specifies the color that will be used for the guidance frame.
CaptureCriteria Object capture criteria options
Properties
Name Type Attributes Description
SelfieDetectionSettings Object <optional>
Selfie detection settings
Properties
Name Type Attributes Default Description
minimumFaceSize Number <optional>
0.25 Percentage of face fits in the target frame while captureing the selfie. range is (0.25 to 1).
faceAngleTolerance Number <optional>
15 The face angle to detect the face. The valid range is [0 - 60].
centerPoint Object <optional>
center point of the ellipse. Should just be a point with in the bounds of the image height and width.
Properties
Name Type Attributes Description
x Number <optional>
x value of the center. Should just be with in the bounds of the image of the target frame.
y Number <optional>
y value of the center. Should just be with in the bounds of the image of the target frame.
aspectRatio Number <optional>
0 aspect ratio of the ellipse. The aspect ratio of the ellipse that should match the face being searched.The aspect ratio is used to construct the target ellispe that should match the face being searched. If targetFrameAspectRatio > 1, the long edge of the target ellipse will align with the long edge of the camera preview. If 0 < targetFrameAspectRatio < 1, the long edge of the target ellipse will align with the short edge of the camera preview. If the targetEllipseAspectRatio is set to 0, then it will be automatically reset to an image aspect ratio. Setting negative values has the same effect as if 0 was set.
padding Number <optional>
10 padding percent value. Given a center point and aspect ratio, a ellipse frame will be constructed to cover as much of the image as possible without any the distances between a frame edge and image edge falling below the padding distance, calculated as percent of the perpendicular image edge length. Values will be clamped to the range [1-50]. The default value is 10. For example: - Given detection settings with a frame center at the center of the image, and a personal check aspect ratio, the constructed frame will fill the width of the image, leaving a space on the left and right equal to the padding percent of the image width. - Given detection settings with a frame center shifted to the left of the image center, the gap on the right side of the constructed frame will exceed the gap on the left.
CapturedMessage Object captured indication message options
Properties
Name Type Attributes Default Description
message String <optional>
"Done!" The text of the message Specifies the text of the message. The default message is "Done!". You must set a message for anything to be displayed.
textColor String <optional>
"#00F900" The color used to display the text Specifies the color that the message's text will be rendered with. The default color is green.
backgroundColor String <optional>
"#B2000000" The color used to display the background of the message Specifies the color that the message's background are will be rendered with. The full area specified by the size property will be filled with the background color, excluding areas clipped outside of view bounds. The default background color is 0.7 transparent black.
visible Boolean <optional>
True The visibility of the message Specifies whether the message is visible or not. A value of "false" will prevent the message from appearing. A value of "true" will show the message, if there is nothing else to prevent it from appearing. The default value is true. Some objects that use messages, like the capture experience objects, will automatically manage and update this state.
orientation String <optional>
"PORTRAIT" The orientation of the message Use one of the allowed values to set the orientation of the messages being displayed. Once a orientation is set, message stays in that orientation even if the device rotates.In other words this is sticky. If you want to handle the rotation when device rotates, orientation has to be explicitly set again on the message. The default value is PORTRAIT. Allowable values are PORTRAIT, LANDSCAPE, REVERSEPORTRAIT, REVERSELANDSCAPE If you modify the orientation of the message, plugin (underlying SDK) tries to optimally display the message however it may not always get displayed with appropriate size and font. It is recommended to set the size or font appropriately if needed.
fontAndroid Object The font used to display the text of the message on Android platform.
Properties
Name Type Attributes Description
textSize Number <optional>
The text font size of the message The default is -1, which causes the message text font size to be determined as the SDK sees fit.
fontiOS Object The font used to display the text of the message on iOS platform.
Properties
Name Type Attributes Description
fontSize Number <optional>
fontSize the size of the text in the message fontSize by default is -1 which means an optimal size is calculated and displayed. fontSize generally accepts positive numbers. Setting arbitrarily large values to fontSize may not render the font and behavior is not defined.
fontName String <optional>
fontName is the name of the font to be used for the message fontName by default is "HelveticalNeue" fontName complies to the iOS font family names (refer to iOS SDK native documentation to know about supported font families).
position Object The position (center) of the text message. Applicable only on iOS platform. This will not have any impact on Android platform. The message object will be overlay on top of an Image Capture Control with the center of the message being located at this coordinate. Changes in the size of the capture control will usually require updating the position of the message as well. position by default is "auto" position and is set appropriately which is suitable to the parent view. once a new value for position is set (other than default) the "auto" quality is lost and the new value is used. If the value is changed it cannot be reset to default in the current instance. The object has to be recreated and set (typically an experience object has to be recreated). position complies to the co-ordinate system in iOS. Setting arbitrarily large values is not recommended and behavior is not defined.
Properties
Name Type Attributes Description
x Number <optional>
x co-ordinate of the position
y Number <optional>
y co-ordinate of the position
size Object The Size of the text message. Applicable for iOS and Android. 40% of imageCaptureControl size The message object will be rendered with dimensions specified by this property. Text will be contained within this boundary, and any set background color will completely cover this area. The default size has width -1 and height -1 which means an appropriate size is calculated and rendered. If the value is changed it cannot be reset to default in the current instance. In Android, rendering might differ based on device being used. If the value is changed it cannot be reset to default in the current instance. The object on which this is applied has to be recreated and set (typically an experience object has to be recreated). Whenever the orientation of the message has been changed, the size may have to be updated.
Properties
Name Type Attributes Description
width Number <optional>
width of the message
height Number <optional>
height of the message
UserInstructionMessage Object An instructional text box that is displayed to the user while trying to capture a selfie. This instruction will be displayed during periods where other guidance is not available to correct a user. This may happen in particular when the user is holding a device far away from a user, preventing automated detection from recognizing the selfie. The following kfxKUICaptureMessage properties are not supported for this message: - messageIcons - backGround
Properties
Name Type Attributes Default Description
message String <optional>
"Center Face" The text of the message Specifies the text of the message. The default message is "Center Face". You must set a message for anything to be displayed.
textColor String <optional>
"#FF0000" The color used to display the text Specifies the color that the message's text will be rendered with. The default color is red.
backgroundColor String <optional>
"#00000000" The color used to display the background of the message Specifies the color that the message's background are will be rendered with. The full area specified by the size property will be filled with the background color, excluding areas clipped outside of view bounds. The default background color is transparent.
visible Boolean <optional>
true The visibility of the message Specifies whether the message is visible or not. A value of "false" will prevent the message from appearing. A value of "true" will show the message, if there is nothing else to prevent it from appearing. The default value is true. Some objects that use messages, like the capture experience objects, will automatically manage and update this state.
orientation String <optional>
"PORTRAIT" The orientation of the message Use one of the allowed values to set the orientation of the messages being displayed. Once a orientation is set, message stays in that orientation even if the device rotates.In other words this is sticky. If you want to handle the rotation when device rotates, orientation has to be explicitly set again on the message. The default value is PORTRAIT. Allowable values are PORTRAIT, LANDSCAPE, REVERSEPORTRAIT, REVERSELANDSCAPE If you modify the orientation of the message, plugin (underlying SDK) tries to optimally display the message however it may not always get displayed with appropriate size and font. It is recommended to set the size or font appropriately if needed.
fontAndroid Object The font used to display the text of the message on Android platform.
Properties
Name Type Attributes Description
textSize Number <optional>
The text font size of the message The default is -1, which causes the message text font size to be determined as the SDK sees fit.
fontiOS Object The font used to display the text of the message on iOS platform.
Properties
Name Type Attributes Description
fontSize Number <optional>
fontSize the size of the text in the message fontSize by default is -1 which means an optimal size is calculated and displayed. fontSize generally accepts positive numbers. Setting arbitrarily large values to fontSize may not render the font and behavior is not defined.
fontName String <optional>
fontName is the name of the font to be used for the message fontName by default is "HelveticalNeue" fontName complies to the iOS font family names (refer to iOS SDK native documentation to know about supported font families).
position Object The position (Top) of the text message. Applicable only on iOS platform. This will not have any impact on Android platform. The message object will be overlay on top of an Image Capture Control with the center of the message being located at this coordinate. Changes in the size of the capture control will usually require updating the position of the message as well. position by default is "auto" position and is set appropriately which is suitable to the parent view. once a new value for position is set (other than default) the "auto" quality is lost and the new value is used. If the value is changed it cannot be reset to default in the current instance. The object has to be recreated and set (typically an experience object has to be recreated). position complies to the co-ordinate system in iOS. Setting arbitrarily large values is not recommended and behavior is not defined.
Properties
Name Type Attributes Description
x Number <optional>
x co-ordinate of the position
y Number <optional>
y co-ordinate of the position
size Object The Size of the text message. Applicable for iOS and Android. Width is equal to the capture control width and height is 25 points The message object will be rendered with dimensions specified by this property. Text will be contained within this boundary, and any set background color will completely cover this area. The default size has width -1 and height -1 which means an appropriate size is calculated and rendered. If the value is changed it cannot be reset to default in the current instance. In Android, rendering might differ based on device being used. If the value is changed it cannot be reset to default in the current instance. The object on which this is applied has to be recreated and set (typically an experience object has to be recreated). Whenever the orientation of the message has been changed, the size may have to be updated.
Properties
Name Type Attributes Description
width Number <optional>
width of the message
height Number <optional>
height of the message
HoldSteadyMessage Object hold steady message options. This option is available only for Android. Setting this wouldn't work for iOS.
Properties
Name Type Attributes Default Description
message String <optional>
"Hold Steady" The text of the message Specifies the text of the message. The default message is the empty string. You must set a message for anything to be displayed.
textColor String <optional>
"#FFFFFFFF" The color used to display the text Specifies the color that the message's text will be rendered with. The default color is white.
backgroundColor String <optional>
"#00FFFFFF" The color used to display the background of the message Specifies the color that the message's background are will be rendered with. The full area specified by the size property will be filled with the background color, excluding areas clipped outside of view bounds. The default background color is transparent.
visible Boolean <optional>
true The visibility of the message Specifies whether the message is visible or not. A value of "false" will prevent the message from appearing. A value of "true" will show the message, if there is nothing else to prevent it from appearing. The default value is true. Some objects that use messages, like the capture experience objects, will automatically manage and update this state.
orientation String <optional>
"PORTRAIT" The orientation of the message Use one of the allowed values to set the orientation of the messages being displayed. Once a orientation is set, message stays in that orientation even if the device rotates.In other words this is sticky. If you want to handle the rotation when device rotates, orientation has to be explicitly set again on the message. The default value is PORTRAIT. Allowable values are PORTRAIT, LANDSCAPE, REVERSEPORTRAIT, REVERSELANDSCAPE If you modify the orientation of the message, plugin (underlying SDK) tries to optimally display the message however it may not always get displayed with appropriate size and font. It is recommended to set the size or font appropriately if needed.
fontAndroid Object The font used to display the text of the message on Android platform.
Properties
Name Type Attributes Description
textSize Number <optional>
The text font size of the message The default is -1, which causes the message text font size to be determined as the SDK sees fit.
position Object The position (center) of the text message. Applicable only on iOS platform. This will not have any impact on Android platform. The message object will be overlay on top of an Image Capture Control with the center of the message being located at this coordinate. Changes in the size of the capture control will usually require updating the position of the message as well. position by default is "auto" position and is set appropriately which is suitable to the parent view. once a new value for position is set (other than default) the "auto" quality is lost and the new value is used. If the value is changed it cannot be reset to default in the current instance. The object has to be recreated and set (typically an experience object has to be recreated). position complies to the co-ordinate system in iOS. Setting arbitrarily large values is not recommended and behavior is not defined.
Properties
Name Type Attributes Description
x Number <optional>
x co-ordinate of the position
y Number <optional>
y co-ordinate of the position
size Object The Size of the text message. Applicable for iOS and Android. The message object will be rendered with dimensions specified by this property. Text will be contained within this boundary, and any set background color will completely cover this area. The default size has width -1 and height -1 which means an appropriate size is calculated and rendered. If the value is changed it cannot be reset to default in the current instance. In Android, rendering might differ based on device being used. If the value is changed it cannot be reset to default in the current instance. The object on which this is applied has to be recreated and set (typically an experience object has to be recreated). Whenever the orientation of the message has been changed, the size may have to be updated.
Properties
Name Type Attributes Description
width Number <optional>
width of the message
height Number <optional>
height of the message
EyesBlinkInstructionMessage Object no face found message options
Properties
Name Type Attributes Default Description
message String <optional>
"Blink now" The text of the message Specifies the text of the message. The default message is "Blink now". You must set a message for anything to be displayed.
textColor String <optional>
"#FF0000" The color used to display the text Specifies the color that the message's text will be rendered with. The default color is red.
backgroundColor String <optional>
"#00000000" The color used to display the background of the message Specifies the color that the message's background are will be rendered with. The full area specified by the size property will be filled with the background color, excluding areas clipped outside of view bounds. The default background color is transparent.
visible Boolean <optional>
true The visibility of the message Specifies whether the message is visible or not. A value of "false" will prevent the message from appearing. A value of "true" will show the message, if there is nothing else to prevent it from appearing. The default value is true. Some objects that use messages, like the capture experience objects, will automatically manage and update this state.
orientation String <optional>
"PORTRAIT" The orientation of the message Use one of the allowed values to set the orientation of the messages being displayed. Once a orientation is set, message stays in that orientation even if the device rotates.In other words this is sticky. If you want to handle the rotation when device rotates, orientation has to be explicitly set again on the message. The default value is PORTRAIT. Allowable values are PORTRAIT, LANDSCAPE, REVERSEPORTRAIT, REVERSELANDSCAPE If you modify the orientation of the message, plugin (underlying SDK) tries to optimally display the message however it may not always get displayed with appropriate size and font. It is recommended to set the size or font appropriately if needed.
fontAndroid Object The font used to display the text of the message on Android platform.
Properties
Name Type Attributes Description
textSize Number <optional>
The text font size of the message The default is -1, which causes the message text font size to be determined as the SDK sees fit.
fontiOS Object The font used to display the text of the message on iOS platform.
Properties
Name Type Attributes Description
fontSize Number <optional>
fontSize the size of the text in the message fontSize by default is -1 which means an optimal size is calculated and displayed. fontSize generally accepts positive numbers. Setting arbitrarily large values to fontSize may not render the font and behavior is not defined.
fontName String <optional>
fontName is the name of the font to be used for the message fontName by default is "HelveticalNeue" fontName complies to the iOS font family names (refer to iOS SDK native documentation to know about supported font families).
position Object The position (Top) of the text message. Applicable only on iOS platform. This will not have any impact on Android platform. The message object will be overlay on top of an Image Capture Control with the center of the message being located at this coordinate. Changes in the size of the capture control will usually require updating the position of the message as well. position by default is "auto" position and is set appropriately which is suitable to the parent view. once a new value for position is set (other than default) the "auto" quality is lost and the new value is used. If the value is changed it cannot be reset to default in the current instance. The object has to be recreated and set (typically an experience object has to be recreated). position complies to the co-ordinate system in iOS. Setting arbitrarily large values is not recommended and behavior is not defined.
Properties
Name Type Attributes Description
x Number <optional>
x co-ordinate of the position
y Number <optional>
y co-ordinate of the position
size Object The Size of the text message. Applicable for iOS and Android. Width is equal to the capture control width and height is 25 points The message object will be rendered with dimensions specified by this property. Text will be contained within this boundary, and any set background color will completely cover this area. The default size has width -1 and height -1 which means an appropriate size is calculated and rendered. If the value is changed it cannot be reset to default in the current instance. In Android, rendering might differ based on device being used. If the value is changed it cannot be reset to default in the current instance. The object on which this is applied has to be recreated and set (typically an experience object has to be recreated). Whenever the orientation of the message has been changed, the size may have to be updated.
Properties
Name Type Attributes Description
width Number <optional>
width of the message
height Number <optional>
height of the message
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function successCallback(response){
  alert(JSON.stringify(response));
}
function errorCallback(error){
  alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});
selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);
//get the options
selfieCaptureExperience.getOptions(function(success){selfieCaptureExperienceOptions = success},myerrorCB);
//specify the values for the Selfie Capture Experience
selfieCaptureExperienceOptions.CaptureCriteria.focusEnabled = false;
//set the options to capture view
selfieCaptureExperience.setOptions(successCallback,errorCallback,selfieCaptureExperienceOptions)

stopCapture(successCallback, errorCallback)

Calling this method will stop the image capture process.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function successCallback(response){
  alert(JSON.stringify(response));
}
function errorCallback(error){
  alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
      selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);
},function(error){
      alert(JSON.stringify(error));
});

selfieCaptureExperience.stopCapture(successCallback,errorCallback);

takePicture(successCB:, errorCB:)

Calling this method will start the process of monitoring the various constraints passed to determine when a level, focused, and non-blurry shot of the face can be taken. The event listener "addImageCapturedListener" will receive the delegate call back message and will have the corresponding capture image details.
Parameters:
Name Type Description
successCB: Default Success call back function name
errorCB: Default Error call back function name
Returns:
The return value is captured in the 'successCB' for a successful operation, and might return in 'errorCB' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCB : success string indicating the method has been invoked errorCB : error in case any error occurs
Example
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var selfieCaptureExperience =  kfxCordova.kfxUicontrols.createSelfieCaptureExperience();
var imageCaptureControlID = null;
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});
selfieCaptureExperience.bindCaptureControl(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));},imageCaptureControlID);
selfieCaptureExperience.takePicture(function(success){alert(JSON.stringify(success));},function(error){alert(JSON.stringify(error));});