DEVELOPER GUIDE / MOBILE SDKs

A connection you can build on.

Start with the SDK. Choose your purchase integration. Connect subscription events to the affiliate who started the relationship.

01 / YOUR WORKSPACE

Give your app a home.

Create an account, then a workspace and application in the developer dashboard. Enter your app’s canonical store destinations. Create an affiliate, assign a commission rate, and generate a tracking link.

Create a workspace

React Native 1.1.1 is live on npm. Swift, Kotlin and Flutter are not yet published; their next planned release is 1.0.1. The SDK connects to Relay Track automatically.

02 / INSTALL

Install React Native 1.1.1.

Install @relay-track/react-native from your Expo app root. The same package supports iOS and Android.

terminal — Expo app root
npx expo install expo-crypto @react-native-async-storage/async-storage
npm install @relay-track/react-native@1.1.1

After adding the SDK, rebuild and launch each platform you ship using your app’s usual native build workflow. Expo Go and over-the-air updates cannot install the native module.

03 / PUBLIC APP CONFIGURATION

Initialize once. Keep the evidence.

Copy the public application UUID from Developer setup in your dashboard and initialize once in your shared app startup code. The SDK connects to Relay Track automatically.

app.ts — initialize Relay Track
import { RelayTrack } from '@relay-track/react-native';

await RelayTrack.initialize({
  applicationId: 'YOUR_PUBLIC_APPLICATION_UUID',
  allowedLinkUrls: [],
});

The SDK persists an application-local installation ID and pending evidence, with bounded delivery retries. Read attribution after initialization; an unresolved result is not permission to invent a referral.

allowedLinkUrls: [] disables direct-link ingestion, while Android Install Referrer remains enabled. For direct links, configure exact allowed HTTPS origins and paths, and set up App/Universal Link ownership in your host app. Deferred and Android referral acquisition must precede the original installation record. Explicit iOS Universal Link events also support installed apps. For iOS referral recovery, follow the domain and Paste control instructions in Developer setup.

Swift, Kotlin and Flutter: coming next.

Choose one SDK engine per app installation. Swift and Kotlin have their own durable storage; switching from React Native does not migrate its installation identity. Flutter uses the native engines and has no Dart attribution engine.

Swift · iOS 15.1+ · Swift Package Manager

Version 1.0.1 is planned and is not published yet. The configuration below is a preview; registry installation instructions will appear here after release.

Swift — initialize
import RelayTrack

let config = try RelayConfiguration(
    applicationID: "YOUR_PUBLIC_APPLICATION_UUID",
    iosLinkOrigin: "https://YOUR_PUBLIC_APPLICATION_UUID.YOUR_LINK_DOMAIN"
)
try await RelayTrack.shared.initialize(config)
let attribution = try await RelayTrack.shared.attribution()
try await RelayTrack.shared.retryPending()
// Forward cold/warm links and scene lifecycle; see the package README.

Kotlin · Android API 24+ · Gradle library / AAR

Version 1.0.1 is planned and is not published yet. The configuration below is a preview; registry installation instructions will appear here after release.

Kotlin — initialize
import com.relaytrack.sdk.RelayTrack
import com.relaytrack.sdk.RelayConfiguration

// Inside a host coroutine:
RelayTrack.initialize(applicationContext, RelayConfiguration(
    applicationId = "YOUR_PUBLIC_APPLICATION_UUID"
))
val attribution = RelayTrack.getAttribution()
RelayTrack.retryPending()
// Forward Activity lifecycle with setActive; Play Referrer is native.

Flutter · Android & iOS · Dart API backed by native engines

Version 1.0.1 is planned and is not published yet. The configuration below is a preview; registry installation instructions will appear here after release.

Flutter — initialize
import 'package:relay_track/relay_track.dart';

await RelayTrack.initialize(const RelayConfiguration(
  applicationId: 'YOUR_PUBLIC_APPLICATION_UUID',
  iosLinkOrigin: 'https://YOUR_PUBLIC_APPLICATION_UUID.YOUR_LINK_DOMAIN',
));
final attribution = await RelayTrack.getAttribution();
await RelayTrack.retryPending();
// iOS: offer RelayReferralPasteButton after initialization.
// Forward host lifecycle and incoming links; see the example.

On iOS, configure the exact application domain, AASA and signed Associated Domains entitlement. Offer explicit Paste Referral. Android uses Google Play Install Referrer.

04 / PURCHASE ATTRIBUTION

Using RevenueCat without a backend?

React Native 1.1.1 supports anonymous and signed-in RevenueCat customers without a customer backend. In RevenueCat setup, choose “From my app with RevenueCat” before the first installation report. Developer setup shows how to set the relay_referral customer attribute before the first purchase or trial.

A referred installation’s reference stays with its first RevenueCat customer. Switching customers on the same installation causes a conflict; it does not transfer the referral. Handle the conflict without blocking checkout. For shared devices or verified account ownership, use the trusted-backend integration.

Using your own backend

Send the installation UUID to your own authenticated backend. Your server must verify its user and that installation’s association with the session before calling Relay Track. Arbitrary user or billing customer IDs from a device are not proof of ownership.

Create a host-server credential in Credentials. Keep it in your server’s secret storage, separate from webhook authorization. These are server HTTP contracts, not mobile SDK calls.

server — user identity binding
// Run on your trusted server after authenticating your user.
// Never send HOST_SERVER_SECRET to your mobile app.
POST /v1/applications/{application_id}/identity-bindings
Authorization: Bearer <HOST_SERVER_SECRET>
Content-Type: application/json

{
  "install_id": "<verified installation UUID>",
  "external_user_id": "<authenticated user ID>"
}

Assign or verify the RevenueCat App User ID on your server. Bind it to the same authenticated host user, then configure RevenueCat in the app with that verified customer identity.

server — RevenueCat identity binding
POST /v1/applications/{application_id}/billing-identities
Authorization: Bearer <HOST_SERVER_SECRET>
Content-Type: application/json

{
  "provider": "revenuecat",
  "external_user_id": "<same authenticated user ID>",
  "provider_customer_id": "<server-assigned RevenueCat App User ID>"
}

Public application IDs identify an app; they do not authorize host actions. Never place host, internal, or webhook credentials in mobile bundles or public browser configuration. Rotate lost credentials through the dashboard.

05 / SUBSCRIPTION EVENTS

Connect the existing billing flow.

  1. In Relay Track, open your application’s RevenueCat page and enter the App ID from the individual store configuration in RevenueCat → Apps. Copy the RevenueCat-generated App ID that starts with app. The project ID, Apple’s numeric App Store ID, and your Android package name are separate fields. If you ship on the App Store and Google Play, enter both App IDs on the same Relay Track application. Select the accepted event environment.
  2. You can correct a saved ID before the first non-test webhook arrives and add a second ID later. After that first event, contact support to remove or replace an ID.
  3. Create a separate RevenueCat webhook credential in Credentials and save the reveal-once value securely.
  4. In RevenueCat, configure the webhook URL shown by Relay Track and its Authorization header: Bearer <webhook credential>. Match the configured environment. If both stores are in a project dedicated to your app, scope the webhook to all apps. If the project also contains unrelated apps, use a separate webhook configuration for each store with the same URL and header.
  5. With Sandbox allowed, use Send a Test Webhook in RevenueCat and refresh integration health in Relay Track. The test receipt confirms delivery. A sandbox purchase verifies the App ID mapping and can exercise attribution and commission processing.
  6. Continue using RevenueCat for offerings, purchases and entitlements. Relay Track handles eligible received financial events and affiliate accruals.

Initial purchases and renewals create distinct transactions. Supported full refunds add immutable offsets at the original commission rate. Ordinary cancellation and expiration do not trigger refunds or reverse commissions.

HTTP receipt means durable acceptance, not proof of completed financial processing. Inspect observed integration activity and reports; missing identity can defer processing. Events that never reach Relay Track cannot appear as received revenue.

06 / VERIFY THE CONNECTION

Test a real acquisition path.

Allow Sandbox or Production + Sandbox in Integrations and match that choice in RevenueCat. Create a normal affiliate named QA Test Affiliate and use its referral link. Select Sandbox in Reports to inspect test purchases and commissions. Sandbox commissions never become payout eligible; this does not change Stripe or your Relay Track subscription. All reports keep totals separated by environment.

  1. Use an enrolled Google Play tester with your app available on its testing track. Begin before installing the app.
  2. On the Android phone, open the affiliate link, follow its redirect to Google Play, and install from that redirected listing.
  3. Launch and initialize with the correct public application ID and HTTPS origin. Confirm the attribution result and installation identity.
  4. Connect the purchase using the mobile referral attribute or both authorized server bindings. With Google license testing configured, make an actual sandbox purchase through RevenueCat.
  5. Check provider webhook delivery, then sandbox transactions and commissions in your dashboard. Verify the original affiliate, revenue, currency, and applied rate.

Do not sideload, inject referrer data, or manually handle a link as a substitute for real Play acceptance. Keep sandbox and production reports separate. For deferred or failed received events, use protected operator inspection/replay; no automated payout or unattended recovery SLA is implied.

Open your workspace