An Alloy titanium widget passcode implementation.
gittio install eg.abada.passcode
Download the latest release, and add in your config.json, under dependencies:
"dependencies": {
"eg.abada.passcode": "*"
}
<Widget id="PassCodeWidget" src="eg.abada.passcode" code="1234" />
// Set the success callback
$.PassCodeWidget.setOnSuccess(function() {
alert("Passed!")
});
var $pc = Alloy.createWidget('eg.abada.passcode', { code: "1234" });
$pc.setOnSuccess(function() {
// Do the next private things
});
$window.add($pc.getView());
Define the callback to invoke when the user inserts the correct code.