Flutter
FingerprintJS Pro Flutter is an official open-source library for the Flutter ecosystem. The package is also published at pub.dev package repository. This library supports Android, iOS, and web platforms.
Sample usage
- Add
fpjs_pro_plugin
to thepubspec.yaml
in your Flutter app.
dependencies:
flutter:
sdk: flutter
...
fpjs_pro_plugin: ^1.3.0
- Identify the visitor
import 'package:fpjs_pro_plugin/fpjs_pro_plugin.dart';
// ...
// Initialization
class _MyAppState extends State<MyApp> {
@override
void initState() async {
super.initState();
await FpjsProPlugin.initFpjs('<public-api-key>'); // insert your public API key here
}
// ...
void identify() async {
try {
visitorId = await FpjsProPlugin.getVisitorId() ?? 'Unknown';
deviceData = await FpjsProPlugin.getVisitorData();
// use the visitorId or deviceData with more info about the visitor
} on PlatformException catch (e) {
// process an error somehow
}
}
}
Documentation
You can find the full documentation in the official GitHub repository. The repository also contains an example app demonstrating usage of the library.
Updated 6 months ago