getVisitorData static method
Returns the visitor data generated by the native Fingerprint Pro client Support tags Support linkedId Throws a FingerprintProError if identification request fails for any reason
Implementation
static Future<List<Object>> getVisitorData(
{Object? tags, String? linkedId}) async {
if (!_isInitialized) {
throw Exception(
'You need to initialize the FPJS Client first by calling the "initFpjs" method');
}
try {
FingerprintJSAgent fp = await (_fpPromise as Future<FingerprintJSAgent>);
final getOptions = FingerprintJSGetOptions(
linkedId: linkedId, tag: tags, extendedResult: _isExtendedResult);
final IdentificationResult result =
await promiseToFuture(fp.get(getOptions));
FingerprintJSProResponse typedResult;
if (_isExtendedResult) {
typedResult = FingerprintJSProExtendedResponse.fromJsObject(
result as IdentificationExtendedResult);
} else {
typedResult = FingerprintJSProResponse.fromJsObject(result);
}
final serializedResult = typedResult.toJson();
return [
typedResult.requestId,
typedResult.confidenceScore.score,
serializedResult
];
} catch (e) {
throw unwrapWebError(e as WebException);
}
}