iproov-cordova-plugin
v1.0.2
Published
Cordova plugin wrapping iProov native SDKs
Downloads
52
Readme
iProov Cordova Plugin
DISCLAIMER:
This Cordova plugin is a Wultra-driven project, tailored for the needs of their clients and is not officially maintained or supported by iProov. For official support and updates, please refer to iProov.
How to integrate
Add the plugin to your Cordova project using the following command:
cordova plugin add iproov-cordova-pluginCustom localizations
List of available languages
The plugin package currently includes the following additional localizations:
- Russian (ru)
- Romanian (ro)
- Czech (cs)
The plugin can merge extra language files from its bundled custom-localization/ folder into the generated iOS and Android host projects.
Each language is opt-in. Add one config entry per language to the host app config.xml:
<preference name="IProovLocalization_ru" value="true" />
<preference name="IProovLocalization_ro" value="true" />You can also use plugin variables if you prefer that style:
<plugin name="iproov-cordova-plugin" spec="...">
<variable name="IPROOV_LOCALIZATION_RU" value="true" />
<variable name="IPROOV_LOCALIZATION_RO" value="true" />
</plugin>The hook runs during after_prepare and also after plugin/platform add so the generated projects stay synchronized. On iOS it creates missing .lproj folders and registers them in the Xcode project. On Android it creates the correct values-* resource directory and merges missing <string> entries into strings.xml.
When enabled, the plugin adds localization files into the generated host project, but it does not remove those files again when the plugin is uninstalled. Cleaning up those files is up to the developer.
To opt out, remove the relevant entry from config.xml or set its value to false.
External documentation
API for this plugin is documented in the iProov React Native Plugin, which this Cordova Plugin is based on.
The API for this plugin is documented in the iProov React Native Plugin, on which this Cordova Plugin is based.
Please refer to the iProov React Native Plugin Documentation for detailed usage instructions.
Example usage
import { IProov } from "iproov-cordova-plugin"
const token = "TOKEN_FROM_YOUR_BACKEND" // Obtain this token from your backend
const url = "wss://eu3.rp.secure.iproov.me/ws" // Use the appropriate URL for your region
const options = null // You can provide additional `IProovOptions` if needed.
console.log("Starting iProov presence check...")
// Launch the iProov presence check. The call will wait until the process is completed.
const iProovResult = await IProov.launch(url, token, options, (event) => {
// Handle iProov events here during the presence check
console.log(`iProov event: ${event.name}`)
})
// The presence check is completed when the above call returns a result
console.log(`iProov presence check completed with result: ${JSON.stringify(iProovResult)}`)