Freedom Pay
  1. Device ID
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Payment Cards
      • Overview
      • Dictionaries
      • Bulk issue
      • Issue card
      • Issue plastic card
      • Activate card
      • Block card
      • Unblock card
      • Set PIN
      • Reset PIN counter
      • Close card
      • Update client
      • Card info
      • Balance
      • Secret data
      • Secret data (version 2)
      • Statement
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction request' status
      • Transaction info
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Overview
      • Design
      • iOS SDK
      • Android SDK
      • OAuth2
        • Authorization link
        • Token exchange
        • Token refresh
        • User info
        • Request profile
        • Get profile status
        • Create user
        • Update user
      • OIDC
        • Authorization endpoint
        • Token exchange
        • Userinfo
      • Error codes
      • Examples
        • Keycloak
    • Transfer
      • Overview
      • Get token
      • Refresh token
      • Get agents
      • Fees
      • Create person
      • Create business
      • Create transfer
      • Print application
      • Confirm
      • Search
      • Payout
      • Payout confirm
      • Cancel
      • Get person info
      • Get business info
      • Status
      • Info
    • Device ID
      • Android SDK
      • iOS SDK
  1. Device ID

Android SDK

Device ID#

Introduction
Installation Instructions
Note on Version Conflicts
Parameter Collection and Permissions
Potential Required Permissions
Permission Usage Risk Assessment
Usage
Device ID Initialization
Request ID Generation
Clear the SDK
Data Structures
IdentifierResult Structure
IdentificationsErrors Structure
Support

Introduction#

Welcome to Device ID SDK, a reliable solution for device identification and fingerprinting across your applications. This SDK provides a comprehensive set of tools to uniquely identify devices, track usage patterns, and enhance security measures through advanced device recognition techniques.
The Device ID SDK allows you to generate and manage persistent device identifiers that remain consistent across user sessions, application updates, and in various network conditions. By utilizing Device ID SDK, you can create a more secured and personalized experience for your users.

Installation Instructions#

1. Prepare directory#

Make sure to create a libs folder in your app module if it doesn't exist.

2. Unzip archive#

Place contents of the provided ZIP archive in the libs folder.

3. Add repositories#

4. Add dependency#

Add the following lines to your app module's build.gradle.kts file:

5. Add packaging options#

To ensure proper inclusion of native libraries (.so files) when building your app, add the following to your build.gradle.kts file:

6. Sync the project#

Note on Version Conflicts#

To avoid dependency version conflicts, we recommend explicitly managing all versions of dependencies used by the SDK and your project. Below is a list of libraries used by the FreedomID SDK along with their versions.
Make sure your project dependencies are aligned with these versions to ensure compatibility:
LibraryVersion
org.jetbrains.kotlin:kotlin-reflect1.9.23
androidx.compose:compose-bom2024.12.01
androidx.compose.material3:material3Managed by BOM
androidx.compose.ui:ui-tooling-previewManaged by BOM
androidx.lifecycle:lifecycle-runtime-compose2.7.0
androidx.activity:activity-compose1.9.0
com.google.accompanist:accompanist-systemuicontroller0.28.0
androidx.biometric:biometric1.1.0
androidx.preference:preference1.2.1

Parameter Collection and Permissions#

The Device ID SDK collects various device parameters to generate accurate fingerprints. Some of these parameters require specific permissions to be granted by the user. Additionally, certain parameters that were previously accessible without permissions may require explicit permissions on newer Android versions.
The Device ID SDK is designed to gracefully handle cases where permissions are not available, continuing to function even without any permission listed in Potential Required Permissions, though identification confidence may be reduced. Each permission may affect identification strength differently, but the Device ID SDK will automatically adapt its identification methods based on available permissions.
To ensure optimal functionality, please review the following section carefully.

Potential Required Permissions#

The Device ID SDK may utilize any of the following permissions depending on your configuration:
⚠️ Warning: Some of the permissions listed below may lead to Google Play Store rejection, privacy concerns, and reduced user trust. Please review Permission Usage Risk Assessment and justify each permission carefully before implementation.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
  <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
</manifest>

Permission Usage Risk Assessment#

Critical Risk#

REQUEST_INSTALL_PACKAGES: Allows your app to request installing other packages. Likely to cause app rejection due to security concerns, limited to app stores and device management apps, and triggers manual review processes.

High Risk#

QUERY_ALL_PACKAGES: Allows querying information about all installed applications. Google Play restricted since Android 11, requires explicit justification, and is rarely approved for general-purpose applications.
READ_PHONE_STATE: Allows access to phone state and identity. Privacy-sensitive permission that requires clear justification, often rejected when used for tracking or analytics purposes.

Medium Risk#

ACCESS_FINE_LOCATION: Allows precise location access. Requires core functionality justification, heavily restricted for background usage, must provide clear user benefit, and requires explicit privacy policy coverage.
READ_GSERVICES: Allows reading from Google services. Raises review flags due to being unusual

Usage#

Device ID Initialization#

To initialize the Device ID SDK, call the create method of the DeviceID class. This method requires one parameter:
An Android context.

Request ID Generation#

Note on Type Alias
Throughout the following documentation, RequestId will be referenced as a distinct type. Please be aware that RequestId is implemented as a Kotlin type alias for String.
To generate RequestId, call the getRequestID method of the DeviceID class. This method obtains a unique identifier RequestId that will track the fingerprinting transaction through the system.
The getRequestID method takes one parameter:
A callback function that is invoked when you attempt to generate RequestId.
The process returns an IdentifierResult<RequestId> IdentifierResult Structure object, which can be either:
Success: Contains a RequestId
Error: Specifies the type of error that occurred.
Cleared: SDK's internal state has been cleared.
Here's an example:

Clear the SDK#

To clear the SDK, call the clear method of the DeviceID class.
This method clears the SDK's internal state and releases any resources used during the RequestID generation process.

Data Structures#

IdentifierResult Structure#

General Description#

The IdentifierResult is a sealed interface representing the result of the RequestId generation process. It has three primary branches:
1.
Success: Indicates that RequestId has ben generated successfully with RequestId as its parametric payload.
2.
Error: Represents various types of errors that may occur during the RequestId generation process. Each error type is modeled either as :

a. A data object for static cases

b. Or a data class for cases requiring additional information.
3.
Cleared: Represents a clean state where identification data has been reset in the SDK.

Table 1: IdentifierResult<T>#

TypeDetails
Cleared<Nothing>Implies, that the SDK has been cleared
Error<Nothing>Describes various errors that could happen during RequestId generation process.
Success<T>A successful result containing RequestId

Table 2: Error (Subtype of IdentifierResult)#

TypeDetails
IdentificationErrorContains a IdentificationErrors Structure object.
VerificationErrorIndicates that the verification process failed.
NotInitializedYetRepresents a state where the SDK has not been properly initialized before use.
InvalidDataErrorIndicates that provided data is corrupted, incomplete, or does not match expected formats.
UnknownRepresents an unknown error type.

IdentificationErrors Structure#

General Description#

The IdentificationErrors enum defines a set of specific error conditions that can occur during various stages of the identification process, from receiving and validating requests to processing session data and handling expired credentials.

Table: IdentificationErrors#

ValueDetails
SESSION_PROCESSING_ERROROccurs while initializing or managing the user session.
INCORRECT_REQUEST_STRUCTUREIndicates that the request structure is invalid or constructed incorrectly.
DATA_PROCESSING_ERROROccurs during the processing of the provided data
REQUEST_VALIDATION_ERROROccurs when the input data fails to meet backend rules.
REQUEST_RECEIVING_ERRORRepresents an error that occurred while receiving the request.
EXPIRED_DATA_ERRORIndicates that the data provided in the request has exceeded its validity period or timestamp and is no longer accepted by the system.

Support#

If you have questions or need help integrating the SDK, feel free to reach out! 👋
Email: support@freedompay.kz
Modified at 2025-04-24 17:57:27
Previous
Info
Next
iOS SDK