Android SDK

A small library that uses Google Play Integrity to confirm that the tester installed the app from Google Play and opens it every day on a real device. It is optional: without the SDK testers check in on the website.

📖 Step by step with screenshots: where to get the SDK and how to add it

How it works

  1. In TestSwap the tester gets a personal Google Play link to your app with a tag.
  2. On first launch the SDK reads the tag via the Google Play Install Referrer, so TestSwap knows whose participation it is.
  3. Once a day the SDK gets a one-time code from TestSwap and requests a Play Integrity token from Google Play. TestSwap decrypts it with your app’s keys and checks in the day only if Google confirms the app was installed from Google Play by this account, on a certified device.
  4. Other users of the app (not from TestSwap) send nothing: without the tag the SDK does nothing.

Setup

Add the JitPack repository to settings.gradle(.kts):

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

Add the dependency to the app module’s build.gradle(.kts) (the app’s minSdk must be 23 or higher):

dependencies {
    implementation("com.github.yednamo:testswap-sdk-android:0.3.0")
}

Initialize the SDK in Application.onCreate() with the app key from your TestSwap dashboard:

import com.yednamo.testswap.TestSwap

class App : Application() {
    override fun onCreate() {
        super.onCreate()
        TestSwap.init(this, "tsk_...key_from_dashboard...")
    }
}

In the TestSwap dashboard, add the Play Integrity response keys from Play Console (classic requests, your own encryption keys). Without them the app does not appear in the catalog.

Privacy

The SDK sends only the app key, the participation token from the install tag and the Google Play Integrity token. TestSwap stores only the verification result (passed or not, and why), with no device identifiers, advertising IDs or user data. The Integrity token is produced by Google Play: describe your use of the Play Integrity API and TestSwap in your privacy policy and Data safety section.

Source code

The SDK is open source (MIT): github.com/yednamo/testswap-sdk-android