Skip to content

fingerprintjs/fingerprintjs-pro-android-demo

Repository files navigation

Fingerprint logo

Discord server Android minAPI status

Get it on Google Play

Fingerprint Pro Android

Official Android library for 100% accurate device identification, created for the Fingerprint Pro API.

import com.fingerprintjs.android.fpjs_pro.Configuration
import com.fingerprintjs.android.fpjs_pro.FingerprintJSFactory
...

// Trust your user's identifiers with the Fingerprint Pro

val fpjsClient = FingerprintJSFactory(applicationContext).createInstance(
     Configuration(
        apiKey = "your-public-api-key"
  )
)

fpjsClient.getVisitorId { result ->
    val visitorId = result.visitorId
    // Use the visitorId
}

Introduction

Fingerprint Pro is a professional visitor identification service that processes all information server-side and transmits it securely to your servers using server-to-server APIs.

This identification library generates an accurate, sticky, and stable Fingerprint Pro visitor identifier in Android apps. The identifier is linked to a device, i.e. it is the same in all the apps on a device, even if you reinstall or clone them. This library requires a free API key to connect to the Fingerprint Pro API.

For local Android fingerprinting and identifying without making requests to API take a look at the fingerprintjs-android repository.

If you are interested in the iOS platform, you can also check our Fingerprint Pro iOS.

Smart Signals

  • Fingerprint PRO now supports a Smart Signals functionality, including Root Detection and Emulator detection. The results are available in the response of the GET /events Server API method.
  • Access to the Smart Signals functionality is currently only available upon request for Enterprise customers. Contact Support (support@fingerprint.com) to enable it for your subscription.

Quick start

Requirements

The Android SDK requires Android 5.0 (API level 21+) or higher.

Add the repository to the gradle.

If your version of Gradle is earlier than 7, add these lines to your build.gradle.

allprojects {	
  repositories {
  ...
  maven { url 'https://maven.fpregistry.io/releases' }	
  maven { url 'https://jitpack.io' }	

}}

If your version of Gradle is 7 or newer, add these lines to your settings.gradle.

repositories {
  ...
  maven { url 'https://maven.fpregistry.io/releases' }	
  maven { url 'https://jitpack.io' }	

}

Add the dependency to your build.gradle file.

dependencies {
    ...
  implementation "com.fingerprint.android:pro:2.4.0"
}

Note: Fingerprint PRO Android uses FingerprintJS Android, kotlin-stdlib and androidx.core:core as dependencies. Additionally, com.google.android.gms:play-services-location is required when Geolocation Spoofing Detection Smart Signal functionality is used.

Sync gradle settings.

Get the visitor identifier

Retrieve the visitor identifier using Public API key. You can find your Public API key in your dashboard.

Kotlin example
import com.fingerprintjs.android.fpjs_pro.Configuration
import com.fingerprintjs.android.fpjs_pro.FingerprintJSFactory
...

// Initialization
val factory = FingerprintJSFactory(applicationContext)
val configuration = Configuration(
    apiKey = "your-public-api-key"
  )
 
val fpjsClient = factory.createInstance(
    configuration
)

// Usage
fpjsClient.getVisitorId { visitorIdResponse ->
    val visitorId = visitorIdResponse.visitorId
    // Use the ID
}
Java example
import com.fingerprintjs.android.fpjs_pro.Configuration;
import com.fingerprintjs.android.fpjs_pro.FingerprintJS;
import com.fingerprintjs.android.fpjs_pro.FingerprintJSFactory;
...

FingerprintJSFactory factory = new FingerprintJSFactory(this.getApplicationContext());
Configuration configuration = new Configuration(
    "your-public-api-key"
    );

FingerprintJS fpjsClient = factory.createInstance(
    configuration
);

fpjsClient.getVisitorId(visitorIdResponse -> {
    // Use the ID
    String visitorId = visitorIdResponse.getVisitorId();
    return null;
});

Privacy notes

When publishing to the Play Market make sure you've noted the following information about collected data:

Data Types Collected Shared Processed ephemerally Required or Optional Purposes
User IDs Yes No No Required Fraud Prevention
Device or other IDs Yes No No Required Fraud Prevention

Additional Resources

License

This application is MIT licensed. Copyright FingerprintJS, Inc 2021-2022 (c)

About

Official Android agent & SDK for 100% accurate device identification, created for the Fingerprint Pro identification API.

Topics

Resources

License

Stars

Watchers

Forks

Languages