Add Frak to your mobile app
Section titled “Add Frak to your mobile app”Frak ships native SDKs for Android and iOS, so the referral loop that works on your website also works inside your app: a customer shares, a friend installs or buys, and the reward is paid on a confirmed order.
What you get
Section titled “What you get”| Capability | Android | iOS |
|---|---|---|
| Share sheet with a personal referral link | Yes | Yes |
| Reward amounts to display in your UI | Yes | Yes |
| Interaction and purchase tracking | Yes | Yes |
| Referral deep links into your app | Yes | Yes |
| Handoff to install the Frak wallet | Yes | Yes |
Both SDKs split into two pieces: a core with no user interface (nothing pulls in a web view) and an optional UI piece that adds the ready-made sharing sheet.
The three steps
Section titled “The three steps”-
Register your merchant account. Sign in to the business dashboard and note your merchant ID. Your mobile app passes it explicitly at startup. See Register your site.
-
Add the SDK to your app. Initialize it once, show a share button, and track your orders. The full walkthrough is in the developer guides below.
-
Confirm orders from your backend. Same as on the web: a signed webhook from your server is what actually releases the reward. See Validate purchases from your backend.
Install and initialize
Section titled “Install and initialize”Requires Android 7.0 (API 24) and Java 17. Add the artifacts:
dependencies { implementation("id.frak.sdk:core:1.0.0-beta.1") // Only if you show the sharing sheet implementation("id.frak.sdk:ui:1.0.0-beta.1")}Initialize once, in Application.onCreate or your launcher Activity:
Frak.initialize( context = applicationContext, config = FrakConfig(merchantId = "your-merchant-id") { metadata = FrakMetadata { name = "Your Store" currency = FrakCurrency.EUR homepageLink = "https://your-store.com" } },)Show the sharing sheet:
val sharing = FrakSharing.Builder(::onShareResult).build(this)sharing.present(SharingRequest { targetInteraction = "purchase" })And track a confirmed order:
Frak.client.tracking.purchase( customerId = "cust_123", orderId = "order_456", token = "a-unique-order-token",)Everything is callable from Java too: every suspending call has a CompletableFuture twin.
Requires iOS 15 and Xcode 16. In Xcode, use File → Add Package Dependencies with https://github.com/frak-id/frak-ios-sdk, or declare it in a Package.swift:
dependencies: [ .package(url: "https://github.com/frak-id/frak-ios-sdk.git", exact: "1.0.0-beta.1")],targets: [ .target(name: "YourApp", dependencies: [ .product(name: "FrakSDK", package: "frak-ios-sdk"), // Only if you show the sharing sheet .product(name: "FrakSDKUI", package: "frak-ios-sdk"), ])]Add the wallet schemes to your Info.plist. Your app cannot detect or open the Frak wallet without them:
<key>LSApplicationQueriesSchemes</key><array> <string>frakwallet</string> <string>frakwallet-dev</string></array>Then initialize once, at app startup:
Frak.initialize( FrakConfig( merchantId: "your-merchant-id", metadata: FrakMetadata( name: "Your Store", currency: .eur, homepageLink: "https://your-store.com" ) ))Show the sharing sheet:
Button("Share and earn") { isSharing = true } .frakSharingSheet(isPresented: $isSharing, request: request) { result in // handle the outcome }And track a confirmed order:
await client.tracking.purchase( customerId: "cust_123", orderId: "order_456", token: "a-unique-order-token")Deep links matter more on mobile
Section titled “Deep links matter more on mobile”A referral link opens in a browser unless your app claims it. Set up App Links on Android (with a published assetlinks.json) and Universal Links or a custom URL scheme on iOS, so a referred friend lands in your app with the referral intact. Both developer guides show the exact manifest and Info.plist entries.
Rewards still need a confirmed sale
Section titled “Rewards still need a confirmed sale”Tracking a purchase from the app tells Frak an order might be coming. The reward is paid once your backend confirms the order with a signed webhook, exactly like the web integration. The order token you send from the app must match the one your server signs.