Requires Swift 6, iOS 16+ or macOS 12+. Resolve the latest stable release in the consuming Swift package and write an exact dependency to Package.swift. No GitHub repository access is needed.
Use import Longplay in application code. This uses Swift Package Registry: declare the dependency in a Swift package, then add that package's product to the Xcode app target. Commit Package.swift, Package.resolved and registry configuration; use swift package resolve --force-resolved-versions in CI. Resolve stable again explicitly when upgrading.
Requires minSdk 23, Java 17 and android.useAndroidX=true in gradle.properties. Resolve stable once at the project root into longplay-sdk.version; builds read that exact version without querying the network.
Add the Longplay repository to dependencyResolutionManagement.repositories in settings.gradle.kts, alongside google() and mavenCentral():
Import ai.tinkerland.longplay.LongplayClient in application code. Gradle reads the POM and module metadata and downloads the AAR; other dependencies remain on Google or Maven Central. Commit longplay-sdk.version and app/gradle.lockfile; omit --write-locks from normal builds. Resolve stable and update locks explicitly when upgrading.
The stable SDK uses protocol 0.10 with https://api.longplayai.com and a Sandbox App and credentials issued by that production deployment. Sandbox still contains production data.
Your backend issues the complete Customer session for its authenticated user: accessToken (Customer Token), refreshToken, customerId, sessionId, expiresAt and refreshExpiresAt. Use identify(session:) in Swift and identify(session) in Kotlin or React Native; call reset at logout. Customer creation, updates and credential issuance belong on the backend.
The SDK refreshes directly with the Longplay API before Access expires, sharing one refresh across concurrent requests. Successful rotation preserves identity and business state. A lost reply retains the Refresh Token for the next attempt; a definitive authentication refusal or expired Refresh Token requires a new login. Refresh never automatically replays a business write.
Clients use only the Access Token to read the current Customer's holdings and entitlements; a Refresh Token cannot access business endpoints. Passing only an Access Token leaves renewal to the host. Never ship a Server Key in the app.
Relay usage through your own authenticated backend. The backend selects the Customer from the app session and calls a server SDK with its Server Key; retries retain the original idempotencyKey.