riverty logo

Docs

Get Started Login

Android Profile Tracking

Our service for device fingerprinting is accessible for Android devices as well. It assists in precisely recognizing the devices engaging with your mobile application and offers reliable intelligent cues to anticipate potentially risky transactions.

Installation

Profile tracking in your Android app is enabled by the Profile Tracking ‘Collector’ SDK, provided to you by our industry-leading partner Experian. Our implementation team will give you credentials to access and use the Profile Tracking SDK.

There are two ways to install the Profile Tracking SDK for Android. You can choose to use our provider’s Maven repository, or to add an Android Archive ('fat AAR') file.

Installation using Maven repository

Add these lines to your build.gradle.

allprojects {
  repositories {
  ...
  maven {
          url "<RESPOSITORY-URL>"
          credentials {
              username = <CUSTOMER-USERNAME>
              password = <CUSTOMER-PASSWORD>
          }
  }
  ...
}}
dependencies {
  implementation "com.ins.collector:collector-core:latest"
}

Installation using Android Archive (fat AAR) file

Place the collector-fat-aar-release.aar i.e into your app/ module and load via files().

dependencies {
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" // optional -  only if you use this library with Java

  implementation 'androidx.core:core-ktx:1.9.0' // 1.x or later
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1" // 1.x or later
  
  implementation files('collector-fat-aar-release.aar')
}

Quick Start

Configure the ‘Collector’ Profile Tracking SDK with your assigned SHOP_ID, and the collect method with a unique SESSION_ID. Profile tracking data will then be submitted and used for enhanced risk analysis for transactions with matching SESSION_ID.

CollectorFactory
  .getInstance(
    applicationContext, 
    Configuration(
      clientId = "<SHOP_ID>"
    )
  )
  .collect("<SESSION_ID>")
  .addListener { status ->
    Log.i(
      "my-application-tag",
      "Collection status was ${status.getStatus()}"
    )
  }

Profile Tracking API key

The ‘Collector’ Profile Tracking SDK needs an API key for use in production.

Provide your API key in your app's AndroidManifest.xml.

<manifest>
    ...
    <application>
        <meta-data
            android:name="com.ins.collector.API_KEY"
            android:value="<MY-API-KEY" />
        ...
    </application>
    ...
</manifest>

Use In Production Environment

Set your environment explicitly to Environment.PRODUCTION.

CollectorFactory
  .getInstance(
    applicationContext, 
    Configuration(
      clientId = "<SHOP_ID>",
      environment = Environment.PRODUCTION
    )
  )
  .collect("SESSION_ID")
  .addListener { status ->
    Log.i(
      "my-application-tag",
      "Collection status was ${status.getStatus()} with ${status.getSessionId()}"
    )
  }

Note, if no SHOP ID or valid API key are provided, profile tracking will start in TEST mode and any data submitted is lost.

Configuration

Location

User location is an important factor or determining the risk level of a transaction. Profile Tracking will give the best possible result with precise user location. However, your app will always need to have user permission to use location information, in accordance with Android system permission rules.

Profile Tracking can be used with and without precise location data. It is fully your choice whether it makes sense to ask for location permission in your app.

If your app already asks for location permission (for instance, as part of selecting shipping location), then your users may experience little-to-no impact with location data for Profile Tracking. On the other hand, if your app currently makes no use of location data, you would have to add the appropriate permission in a way that makes a good user experience. In that case, you might consider Profile Tracking without precise location — our Implementation team is always available to advise.

  • User’s permission must be granted beforehand. The library does NOT actively prompt the user for permissions.
...
    Configuration(
      ...
      skipLocation = false
      ...
    )
...

Debug

If you experience trouble while integrating the library into your app, you may enable the debug mode.

    Configuration(
      ...
      debug = true
      ...
    )

This enables you to inspect the libraries logs.

2021-05-17 15:04:55.408 6309-6396/com.your.app V/ins.collector.ea7c38e0-c05f-444b-ac4c-be379822377e: module *fingerprintjs* started

Telemetry

In rare cases, you may want engineering assistance related to profile tracking. You can enable telemetry mode in order to facilitate

    Configuration(
      ...
      telemetry = true
      ...
    )

This submits the libraries logs automatically to obtain help with troubleshooting.

Production Mode

Once your app goes into production, explicitly set the library’s environment to PRODUCTION

Excluding Modules

If a module is not needed for your use case or causes trouble, you may choose to exclude it.

Notable options:

  • collector-module-location (see section above about Location configuration)
  • collector-module-logger

Note, If you choose to exclude the logger module, neither debug mode nor telemetry mode is available.

Maven repository

Use exclude in your build.gradle dependency declaration.

implementation("com.ins.collector:collector-core:latest") {
  exclude group: "com.ins.collector", module: "collector-module-logger"
}

FAT AAR File

Use one of the provided fat-aar file variants

  • collector-fat-aar-no-module-logger.aar
  • collector-fat-aar-no-module-logger-location.aar
  • collector-fat-aar-min.aar
  • ...

Google Play publishing

If your Android app includes the Profile Tracking SDK, then you can use the table below as a reference to fill out the Google Play data safety form:

Question in Google Play Console's data safety form Response
Does your app collect or share any of the required user data types? Yes.
What type of data is collected? Device or other identifiers.
Is this data collected, shared, or both? Collected.
Is this data processed ephemerally? Yes.
Why is this user data collected? Fraud Prevention, Security, and Compliance.