new dwn()
- Description:
- The name of the javascript variable that will be used when invoking profiling, defaults to dwn.
The name can be changed in journey.
Example
// create a profiling handle when page loaded
handle = dwn.start(config);
// collect fingerprint data blob, collect() is a promise
handle.collect().then(
(fp_data) => {
// if be sure profiling all done, stop profiling
// otherwise not need to stop it
handle.stop()
// processing FP data blob, send it to API server ...
},
(error) => {
// handle the error
}
);
// collect fingerprint data blob, tryCollect() is NOT a promise will return a fingerprint data blob immediately
fp_data = handle.tryCollect()
// processing FP data blob, send it to API server ...
Methods
(static) collect()
- Description:
- Collecting fingerprint data blob, it returns a Promise
Example
handle = dwn.start(config);
handle.collect().then(
(fp_data) => {
// fp_data is base64 fingerprint data string
},
(error) => {
// handle the error
}
);
(static) stop()
- Description:
- Stopping profiling, only call it when collect() called and be sure all profiling done
It will stop all biometrics event listeners
It's ok if you don't call stop() at all
Example
handle = dwn.start(config);
handle.stop();
let fp_data = handle.tryCollect();
(static) tryCollect()
- Description:
- Collecting fingerprint data blob, it returns fingerprint data string immediately
Example
handle = dwn.start(config);
let fp_data = handle.tryCollect();