@biopassid/signature-sdk-react-native
Version:
BioPass ID Signature SDK React Native module.
28 lines (27 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.takeSignature = takeSignature;
var _reactNative = require("react-native");
var _Utils = require("./utils/Utils");
const LINKING_ERROR = `The package '@biopassid/signature-sdk-react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const SignatureSdkReactNative = _reactNative.NativeModules.SignatureSdkReactNative ? _reactNative.NativeModules.SignatureSdkReactNative : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
async function takeSignature(config) {
try {
const newConfig = (0, _Utils.mergeConfigs)(config);
const result = await SignatureSdkReactNative.takeSignature(newConfig);
return result;
} catch (error) {
console.error(`Unknown error: ${error}`);
return '';
}
}
//# sourceMappingURL=Signature.js.map