Skip to content

Initialization

The DocumentReader initialization works fully offline. It simply use license file, which you can get here: licensing.regulaforensics.com. You should add the regula.license file to your project.

var licPath = Platform.OS === 'ios' ? (RNFS.MainBundlePath + "/regula.license") : "regula.license";
var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileAssets;

readFile(licPath, 'base64').then((res) => {
    DocumentReader.initializeReader(res, (respond) => {
        console.log(respond);

        DocumentReader.getDocumentReaderIsReady((isReady) => {
            if (isReady === true || isReady === "YES")
                this.setState({ fullName: "Successfull" });
            else
                this.setState({ fullName: "Error" });
        }, error => console.log(error));
    }, error => console.log(error));
});
Back to top