Selfie Capture
Selfie Capture will capture a selfie for a tag that may be provided during initiation and if not provided this will be auto generated by the SDK and returned with a code.
Selfie Capture
Selfie Capture will capture a selfie for a tag that may be provided during initiation and if not provided this will be auto generated by the SDK and returned with a code.
Import the package
Capture Selfie
If you want the SDK to generate a tag for you then call the method with an empty string
If you want the generate to use a custom tag send a string to the SDK with alphanumeric characters with the exception of an underscore and no spacing in them.
This will present a screen as below:
Get Results
The selfie capture process is an asynchronous process and will return an error code and a tag once done. The result looks as the below
If the result code is -1 AND the tag is not null or empty then the selfie capture was successful.
Optional Permissions
By default the SDK will request for permissions on it's own particularly on android and the first instance the call to the captureSelfie may fail and will definately fail if the user has not allowed the permissions for camera
It is advisable to then do permissions request prior to calling the captureSelfie method to make sure you handle permissions and perhaps even check for permissions before in that case then the call should be
The false will mean the SDK will try to open the selfie capture and assume permission handling has already been done
Optional UI Customisations
For basic UI customisation, an additional key-value Object needs to be passed as second parameter when performing a call to the library's captureSelfie("<TAG>",HashMap<String, String>(),false
)
)
method, where tag
is a string and config
the added key-value Map containing the desired settings.
Selfie Capture Screen Customisation
capture_title_text
: a string value for the selfie capture screen's title. Refer to Strings and Colours section for details.overlay_color
: a 7-character (no alpha channel) hexadecimal colour string (ie.#FF0000
for red) that sets the background color for the oval overlay view in the selfie capture screenoverlay_alpha
: an integer value ranging from 0 to 255 that controls the transparency of the oval overlay view in the selfie capture screenoverlay_thickness
: an non-bound double value that determines the thickness of the oval overlay's lineoverlay_dotted
: a boolean value that specifies whether the oval overlay's line should dotted or plain (the latter by default).overlay_width
: a non-bound double value that sets the oval shape's width in the selfie capture screenoverlay_height
: same as the above, for the oval shape's heightcapturing_progress_color
: a 7-character (no alpha channel) hexadecimal colour string (ie.#FF0000
for red) that determines the colour of the oval overlay during selfie capturecaptured_progress_color
: a 7-character (no alpha channel) hexadecimal colour string (ie.#FF0000
for red) that determines the colour of the oval overlay after selfie captureprompt_default_text
: a string that determines the default text when the selfie capture view is initialise; this refers to text view directly under the selfie capture viewprompt_blurry_text
: a string that informs the user that selfie is blurryprompt_capturing_text
: a string that informs the user that the selfie capture operation is underwayprompt_do_smile_text
: a string used to prompt the user to smileprompt_compatibility_mode_text
: a string for compatibility-related issueprompt_face_not_found_text
: a string that determines the error message when the face is not found during selfie captureprompt_face_too_close_text
: a string that informs the user that they're positioned outside the acceptable selfie capture distance rangeprompt_idle_text
: a string that informs the user that the selfie capture has remained idle for longprompt_move_closer_text
: a string that prompts the user to move closer to the camera during selfie captureprompt_too_dark_text
: a string used to notify the user that brightness and light intensity is lowcapture_tip_text
: a string used for the tips at the bottom of the selfie capture screen
Selfie Review Screen Customisation
review_title_text
: a string value for the selfie review screen's title.review_prompt_text
: a string that determines the prompt text view on the selfie review screen; this text view refers to the one directly under the selfie image viewreview_prompt_style
: a key-value Object that determines the styling for the prompt text view (the text view directly under the the selfie image view)'s styling - similar to screen_title_stylereview_tip_text
: a string used for the tips at the bottom of the selfie capture screenreview_tip_style
: a key-value Object that sets the styling for the tips text view (the text view directly under the prompt text view in the selfie review screen)'s styling - similar to screen_title_stylereview_confirm_text
: a string value for the confirm button (positive action)'s textreview_confirm_color
: a 7-character (no alpha channel) hexadecimal colour string (ie.#FF0000
for red) that determines the the confirm button's background colour
Basic Example
Last updated