DEVELOPER GUIDE / MOBILE SDKs v0.1.0
A connection you can build on.
Start with the SDK. Keep identity on your server. 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 workspaceAll SDKs are source previews; no npm, Maven, CocoaPods or pub.dev release is published. Use your configured Relay Track backend origin; the restricted E1 acceptance gateway is not a general management API.
02 / INSTALL
Build the React Native package.
Start from a checkout of the Relay Track repository. The compatibility baseline is Expo 54, React Native 0.81, and React 19.1. Bare React Native apps must install Expo modules first.
# From the Relay Track repository
cd sdk/react-native
npm ci
npm pack
# In your Expo 54 / React Native 0.81 app
npx expo install expo-crypto @react-native-async-storage/async-storage
npm install /path/to/relay-track-react-native-0.1.0.tgz
npx expo run:android
Replace the archive path with the file produced by npm pack. Expo supplies the expo-modules-core peer. The native Android bridge requires a new native build; Expo Go and over-the-air JavaScript updates cannot install it.
For iOS, follow your host app’s CocoaPods/prebuild workflow. Installation reporting and eligible direct-link evidence are supported. User-mediated referral paste is available in source; configure the dedicated HTTPS domain and native Paste control in dashboard Setup, then validate on a physical iPhone.
03 / PUBLIC APP CONFIGURATION
Initialize once. Keep the evidence.
Copy the public application UUID from Developer setup in your dashboard. Replace the example API origin with your reachable HTTPS backend. Initialize the SDK at app startup.
import { RelayTrack } from '@relay-track/react-native';
await RelayTrack.initialize({
applicationId: 'YOUR_PUBLIC_APPLICATION_UUID',
apiBaseUrl: 'https://YOUR_API_HOST',
allowedLinkUrls: [], // Android referrer still enabled
});
const installationId = await RelayTrack.getInstallationId();
const attribution = await RelayTrack.getAttribution();
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.
Native and Flutter source previews.
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
Install from source / private preview. Read sdk/swift/README.md in your checkout for lifecycle, link ownership, privacy and build instructions.
In Xcode, choose Add Package Dependencies → Add Local.
Select relay-track/sdk/swift and link the RelayTrack product.
No React Native or Expo dependency.
import RelayTrack
let config = try RelayConfiguration(
applicationID: "YOUR_PUBLIC_APPLICATION_UUID",
apiBaseURL: "https://YOUR_API_HOST",
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
Install from source / private preview. Read sdk/kotlin/README.md in your checkout for lifecycle, link ownership, privacy and build instructions.
// settings.gradle.kts — source integration
include(":relay-track")
project(":relay-track").projectDir = file("../relay-track/sdk/kotlin/relay-track")
// app/build.gradle.kts
// Use the documented compatible AGP/Kotlin plugins and Java 17.
dependencies {
implementation(project(":relay-track"))
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}
// Enable core library desugaring in android.compileOptions.
import com.relaytrack.sdk.RelayTrack
import com.relaytrack.sdk.RelayConfiguration
// Inside a host coroutine:
RelayTrack.initialize(applicationContext, RelayConfiguration(
applicationId = "YOUR_PUBLIC_APPLICATION_UUID",
apiBaseUrl = "https://YOUR_API_HOST"
))
val attribution = RelayTrack.getAttribution()
RelayTrack.retryPending()
// Forward Activity lifecycle with setActive; Play Referrer is native.
Flutter · Android & iOS · Dart API backed by native engines
Install from source / private preview. Read sdk/flutter/README.md in your checkout for lifecycle, link ownership, privacy and build instructions.
# pubspec.yaml — local source dependency
dependencies:
relay_track:
path: ../relay-track/sdk/flutter
# The local iOS example uses CocoaPods:
flutter:
config:
enable-swift-package-manager: false
# Follow the README for iOS 15.1 and Android desugaring setup.
import 'package:relay_track/relay_track.dart';
await RelayTrack.initialize(const RelayConfiguration(
applicationId: 'YOUR_PUBLIC_APPLICATION_UUID',
apiBaseUrl: 'https://YOUR_API_HOST',
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; never read the clipboard at startup. Android uses Google Play Install Referrer. A build or simulator test does not establish physical-device attribution. The new native delivery engines still require focused iOS and Play acceptance.
04 / THE SERVER BOUNDARY
Bind identities you have verified.
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 API keys. Keep it in your server’s secret storage, separate from webhook authorization. These are server HTTP contracts, not mobile SDK calls.
// 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.
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.
- In Integrations, configure the RevenueCat app ID and accepted environment. This provider mapping is fixed after setup; select the correct app.
- Create a separate RevenueCat webhook credential in API keys and save the reveal-once value securely.
- In RevenueCat, configure the webhook URL shown by Relay Track and its Authorization header:
Bearer <webhook credential>. Match the configured environment. - 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.
- Use an enrolled Google Play tester with your app available on its testing track. Begin before installing the app.
- On the Android phone, open the affiliate link, follow its redirect to Google Play, and install from that redirected listing.
- Launch and initialize with the correct public application ID and HTTPS origin. Confirm the attribution result and installation identity.
- Authenticate your app user and complete both authorized server bindings. With Google license testing configured, make an actual sandbox purchase through RevenueCat.
- 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