Integration
RevReach measures the revenue your app makes through a creator's code. You choose how: automatically through RevenueCat, Superwall or Adapty (a read-only webhook from the provider you already use), or by reporting the revenue yourself once a month. You don't need a separate SDK.
How it works
- A user enters a creator's code in your app, redeems an offer code in the store or arrives via the creator's link.
- Your app checks the code via our API and stores it with your subscription provider as the customer attribute
revreach_code. - RevenueCat, Superwall or Adapty send every purchase event to RevReach via webhook. We recognise the code, attribute the user to the creator and book the revenue share.
- Once a month, RevReach settles up: we collect the payment plus our fee from you via Stripe (SEPA direct debit or card) and pay out the creator.
Choose how revenue is measured
| Way | For apps that … | What you set up |
|---|---|---|
| RevenueCat | use RevenueCat | Read-only API key and webhook |
| Superwall | use Superwall | Webhook endpoint |
| Adapty | use Adapty | Webhook integration |
| Monthly report | use none of these (StoreKit or Play Billing directly, own backend, web payments) | Nothing to connect: you report the net revenue via the code by the 5th of the following month |
The way of measuring is part of the contract (deal sheet). You choose it in your match under For the contract. Each app has one active provider. Webhooks from a provider that is not active are logged but not booked, so purchases are never counted twice (for example if you use Superwall together with RevenueCat).
Connect RevenueCat
API key
In RevenueCat, go to Project settings → API keys and create a Secret API key of version V2 with these permissions:
| Area | Permission | Used for |
|---|---|---|
| Charts & Metrics | Read | MRR, active subscriptions, net revenue for the verified numbers |
| Customer information | Read | Looking up the code if it is missing from the webhook |
| Everything else | No access | – |
Enter the key and the project ID in RevReach under Apps → Integration. The key is stored encrypted.
Webhook
- RevenueCat: Integrations → Webhooks → Add new configuration
- URL:
https://revreach.app/api/webhooks/revenuecat/<App-ID>(ready to copy in your dashboard) - Authorization header:
Bearer rr_…(generate it in RevReach; it is only shown once) - Environment: Production and Sandbox. Apps: all apps in the project. Events: all.
- Optional: enable the HMAC signature and store the secret in RevReach.
- Test: click Send test event.
Webhooks are included in RevenueCat's Pro plan, which is free up to $2,500 in monthly revenue. RevenueCat also passes on the store's offer code (offer_code), see offer codes.
Connect Superwall
- Superwall dashboard: Integrations → Webhooks → Add Endpoint.
- URL:
https://revreach.app/api/webhooks/superwall/<App-ID>?token=rr_…. Superwall cannot send its own header, so the token is part of the address. RevReach shows the complete address once when you generate the token. - Subscribe to all event types and save.
- Optional: copy the endpoint's signing secret (Copy Secret, starts with
whsec_) into RevReach. We then only accept requests with a valid signature. - Test: Superwall doesn't send test webhooks. Make a sandbox purchase (TestFlight with a sandbox Apple ID, or a Google Play license tester). Purchases with a local StoreKit configuration file don't trigger webhooks.
We use proceeds as net revenue (after taxes and store commission), the user attribute revreach_code (field userAttributes, set with Superwall.shared.setUserAttributes) and the offer code (offerCode, App Store and Google Play). The customer is identified by originalAppUserId, otherwise by the subscription.
Requirement: Superwall SDK 4.5.2 or later (according to Superwall, originalAppUserId is exactly the ID set with identify from 4.6.0 on iOS; on Android, turn on passIdentifiersToPlayStore in the SuperwallOptions), and the user ID you set with Superwall.shared.identify(userId:) is a UUID: Apple only accepts UUIDs as appAccountToken, otherwise the purchase carries the anonymous alias ID. Without originalAppUserId, we recognise subscriptions by their original transaction; one-time purchases (such as consumables) then do not create a new attribution, because every purchase has its own transaction.
Connect Adapty
- Adapty dashboard: Integrations → Webhook, turn the integration on.
- Production endpoint URL and Sandbox endpoint URL:
https://revreach.app/api/webhooks/adapty/<App-ID>(both). - Authorization header value (production and sandbox):
Bearer rr_…(generate it in RevReach; it is only shown once). - Turn on Send user attributes: the creator code is a user attribute. Keep the default event names.
- Save. Adapty immediately sends a verification request, which RevReach shows as the test event.
We use net_revenue_local (or net_revenue_usd) as net revenue, the custom attribute revreach_code (field user_attributes, set with Adapty.updateProfile) and these events: subscription_started, trial_started, trial_converted, subscription_renewed, non_subscription_purchase and the refund events. Adapty does not pass on store offer codes, so with Adapty the code field is required.
Add the code field
Show an optional “Creator code” field during onboarding or on the paywall. Check the code before you store it so that typos are caught and you can tell the user who referred them.
GET https://revreach.app/api/v1/codes/MIRAFIT?app=YOUR_APP_ID
{ "valid": true, "code": "MIRAFIT", "app_id": "…", "creator": { "handle": "mirafit", "name": "Mira" } }
{ "valid": false }
GET https://revreach.app/api/v1/codes/TEST?app=YOUR_APP_ID
{ "valid": true, "code": "TEST", "app_id": "…", "test": true, "creator": { "handle": "test", "name": "Test" } }You can find the app ID in the dashboard under Apps → Integration in the webhook URL. The API is public, needs no key and is limited to 60 requests per minute per IP address.
The examples store the code in RevenueCat. With Superwall or Adapty, replace the RevenueCat line with the line for your provider (see the table below).
Important: the examples store the first code on the device and send it again with syncCreatorCode() – on every app start and after every login (Purchases.logIn). Customer attributes belong to the app user ID: if someone logs into an existing account after entering the code, the code is otherwise missing there and the purchase does not count for the creator.
Swift
import RevenueCat
struct CreatorCodeResult: Decodable {
let valid: Bool
let code: String?
let creator: Creator?
struct Creator: Decodable { let handle: String; let name: String? }
}
/// Checks the code, stores the first one on the device and sends it to RevenueCat.
func redeemCreatorCode(_ input: String) async throws -> CreatorCodeResult {
let code = input.uppercased().filter { $0.isLetter || $0.isNumber }
var url = URLComponents(string: "https://revreach.app/api/v1/codes/\(code)")!
url.queryItems = [URLQueryItem(name: "app", value: "YOUR_APP_ID")]
let (data, _) = try await URLSession.shared.data(from: url.url!)
let result = try JSONDecoder().decode(CreatorCodeResult.self, from: data)
guard result.valid else { return result }
// The first redeemed code counts: once stored, never overwrite it.
if UserDefaults.standard.string(forKey: "revreach_code") == nil {
UserDefaults.standard.set(code, forKey: "revreach_code")
}
await syncCreatorCode()
return result
}
/// Sends the stored code again. Call it on every app start and after every login – otherwise the code is missing when someone logs into an existing account.
func syncCreatorCode() async {
guard let code = UserDefaults.standard.string(forKey: "revreach_code") else { return }
Purchases.shared.attribution.setAttributes(["revreach_code": code])
// Optional: send the attributes right away instead of with the next purchase
_ = try? await Purchases.shared.syncAttributesAndOfferingsIfNeeded()
}
// App start: Purchases.configure(withAPIKey: …), then Task { await syncCreatorCode() }
// After login: _ = try await Purchases.shared.logIn(userId); await syncCreatorCode()Kotlin
import android.content.SharedPreferences
import com.revenuecat.purchases.Purchases
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.json.JSONObject
import java.net.URL
suspend fun redeemCreatorCode(input: String, prefs: SharedPreferences): Boolean {
val code = input.uppercase().filter { it.isLetterOrDigit() }
val url = URL("https://revreach.app/api/v1/codes/$code?app=YOUR_APP_ID")
val body = withContext(Dispatchers.IO) { url.readText() }
val valid = JSONObject(body).optBoolean("valid", false)
if (!valid) return false
// The first redeemed code counts: once stored, never overwrite it.
if (prefs.getString("revreach_code", null) == null) {
prefs.edit().putString("revreach_code", code).apply()
}
syncCreatorCode(prefs)
return true
}
// Sends the stored code again. Call it on every app start and after every login – otherwise the code is missing when someone logs into an existing account.
fun syncCreatorCode(prefs: SharedPreferences) {
val code = prefs.getString("revreach_code", null) ?: return
Purchases.sharedInstance.setAttributes(mapOf("revreach_code" to code))
}
// App start: Purchases.configure(…), then syncCreatorCode(prefs)
// After login: Purchases.sharedInstance.logInWith(userId, onSuccess = { _, _ -> syncCreatorCode(prefs) })Flutter
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:purchases_flutter/purchases_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future<bool> redeemCreatorCode(String input) async {
final code = input.toUpperCase().replaceAll(RegExp(r'[^A-Z0-9]'), '');
final res = await http.get(Uri.parse('https://revreach.app/api/v1/codes/$code?app=YOUR_APP_ID'));
final valid = res.statusCode == 200 && jsonDecode(res.body)['valid'] == true;
if (!valid) return false;
// The first redeemed code counts: once stored, never overwrite it.
final prefs = await SharedPreferences.getInstance();
if (prefs.getString('revreach_code') == null) {
await prefs.setString('revreach_code', code);
}
await syncCreatorCode();
return true;
}
// Sends the stored code again. Call it on every app start and after every login – otherwise the code is missing when someone logs into an existing account.
Future<void> syncCreatorCode() async {
final prefs = await SharedPreferences.getInstance();
final code = prefs.getString('revreach_code');
if (code != null) await Purchases.setAttributes({'revreach_code': code});
}
// App start: await Purchases.configure(…); await syncCreatorCode();
// After login: await Purchases.logIn(userId); await syncCreatorCode();React Native
import AsyncStorage from "@react-native-async-storage/async-storage";
import Purchases from "react-native-purchases";
export async function redeemCreatorCode(input: string) {
const code = input.toUpperCase().replace(/[^A-Z0-9]/g, "");
const res = await fetch(`https://revreach.app/api/v1/codes/${code}?app=YOUR_APP_ID`);
const json = await res.json();
if (json.valid) {
// The first redeemed code counts: once stored, never overwrite it.
if (!(await AsyncStorage.getItem("revreach_code"))) await AsyncStorage.setItem("revreach_code", code);
await syncCreatorCode();
}
return json;
}
// Sends the stored code again. Call it on every app start and after every login – otherwise the code is missing when someone logs into an existing account.
export async function syncCreatorCode() {
const code = await AsyncStorage.getItem("revreach_code");
if (code) await Purchases.setAttributes({ revreach_code: code });
}
// App start: Purchases.configure({ apiKey: … }); await syncCreatorCode();
// After login: await Purchases.logIn(userId); await syncCreatorCode();Superwall and Adapty
The line goes into syncCreatorCode() (with expo-superwall, useUser() is a React hook: call it in a component and pass update in). Superwall: call it again after Superwall.shared.identify(userId:). Adapty: set the attribute only after Adapty.identify(…) (or after activate with customerUserId) and repeat it after every further identify. updateProfile always writes to the currently active profile; if identify switches to an existing profile, an attribute set before stays with the old one.
Superwall
Swift
Superwall.shared.setUserAttributes(["revreach_code": code])Kotlin
Superwall.instance.setUserAttributes(mapOf("revreach_code" to code))Flutter
Superwall.shared.setUserAttributes({"revreach_code": code});React Native (Expo)
// expo-superwall: useUser() is a hook – call it inside a component
const { update } = useUser();
// then pass update into syncCreatorCode(code, update)
await update({ revreach_code: code });Adapty
Swift
let builder = try AdaptyProfileParameters.Builder()
.with(customAttribute: code, forKey: "revreach_code")
try await Adapty.updateProfile(params: builder.build())Kotlin
Adapty.updateProfile(
AdaptyProfileParameters.Builder().withCustomAttribute("revreach_code", code).build()
) { error -> /* … */ }Flutter
final builder = AdaptyProfileParametersBuilder()
..setCustomStringAttribute(code, 'revreach_code');
await Adapty().updateProfile(builder.build());React Native
await adapty.updateProfile({ codableCustomAttributes: { revreach_code: code } });Offer codes instead of a code field
Instead of (or in addition to) the code field, users can redeem an offer code in the store. If its name is the creator's code, we attribute the purchase to the creator.
- Apple: in App Store Connect, create an offer code whose reference name, and for a custom code the code itself, is exactly the creator's code, e.g.
MIRAFIT(letters and digits only, 4 to 20 characters). - Google Play: offer and promo codes only work for subscriptions and only for new subscribers. Use the creator's code as the code or offer ID.
- RevenueCat reports the code as
offer_code, Superwall asofferCode. Adapty does not report offer codes. - The customer attribute
revreach_codetakes precedence. The offer code counts if there is no valid attribute.
Verify the code field
Before the contract is created, RevReach checks that codes from your app actually arrive:
- Make a purchase in the sandbox and enter the code
TEST. Our code API acceptsTESTfor your app; alternatively, set the attribute toTESTor redeem an offer code namedTEST. - As soon as the event with
TESTarrives, the code field counts as verified. Nothing is booked. - No sandbox purchase possible? Confirm under Apps → Integration that the code field is built in. The confirmation is logged with the time.
Once the code field is verified or confirmed, the contract is created immediately (provided everything else is in place).
Deep link
Creators share links such as https://revreach.app/r/DEMO (an example with a made-up app). The page shows the code for copying and links to the store. If you add a deep link template such as yourapp://code?c={code} under App details, the page also offers “Open app”. Your app reads the code from the link, pre-fills the field and calls the function above.
The stores do not reliably pass on parameters during installation. That is why the entered code (or the offer code) is the reliable source.
Get more users to enter the code
Every purchase without a code is lost to the creator. Two things help most:
- A small benefit for the code. In the terms, enter what users get with the code under Benefit for users with a code, e.g. “14 instead of 7 days free”. The benefit appears in the deal sheet and on the code page (/r/CODE) right below the code. You implement it with the stores' tools (offer codes, promotional offers, Google Play offers), see security.
- Paste instead of typing. The code page has a button to copy the code. Give the code field in your app a paste button. On iOS 16 or later, use SwiftUI's
PasteButton: the system then doesn't ask for permission to paste. On Android, with Flutter and with React Native, only read the clipboard when the user taps the button – never automatically on launch.
SwiftUI (iOS 16+)
HStack {
TextField("Creator code", text: $code)
PasteButton(payloadType: String.self) { strings in
code = strings.first ?? ""
}
}Kotlin (Android)
pasteButton.setOnClickListener {
val clip = context.getSystemService(ClipboardManager::class.java).primaryClip
codeField.setText(clip?.getItemAt(0)?.coerceToText(context) ?: "")
}Flutter
TextButton(
onPressed: () async {
final data = await Clipboard.getData(Clipboard.kTextPlain);
controller.text = data?.text ?? '';
},
child: const Text('Paste'),
)React Native (expo-clipboard)
<Button title="Paste" onPress={async () => setCode(await Clipboard.getStringAsync())} />Monthly report (without a subscription provider)
For apps without RevenueCat, Superwall or Adapty, for example with StoreKit or Play Billing directly, their own backend or web payments.
- Choose Monthly report in your match under For the contract and confirm the reporting duties.
- By the 5th of the following month, report in the partnership the net revenue that came in through the code during the month: after store commission and taxes, minus refunds in that month. Optionally add the number of new users and a note (for example the source). No revenue? Report 0.
- RevReach books the revenue share for the whole month according to your terms (including tiers). There is one report per month; only we at RevReach make corrections, as a counter-entry.
- The creator sees every report and may have the figures audited (contract).
- From the 1st, we remind you about the previous month. If nothing has been reported by the 6th, you get a reminder that the report is overdue, and we are notified.
Tip: store the redeemed code with the user in your backend, or use offer codes and the store reports. Then you can see which revenue came through the code.
Attribution rules
- The code that was set first counts. An attribution is never changed retrospectively.
- Where the code comes from, in this order: the customer attribute
revreach_code; with RevenueCat then$campaignif$mediaSourceis “revreach” (in case you already use RevenueCat's attribution fields); finally the offer code.TESTandDEMOnever attribute. - A new attribution only happens on a first purchase (including the start of a free trial) or when a free trial converts. Renewals by existing subscribers do not trigger a new attribution.
- No new attribution is created by Family Sharing purchases, by €0 purchases (except the start of a free trial) and, with Superwall without
originalAppUserId, by one-time purchases. - If RevenueCat transfers purchases to another app user ID (
TRANSFER, e.g. when purchases are restored under a different account), we carry the attribution over to the new ID. The user still counts once. - A revenue share accrues on payments within the agreed period from attribution, and only while the partnership is running (plus the tail period, if agreed).
- The basis is net revenue after taxes and store commission: with RevenueCat
price × (1 − tax_percentage − commission_percentage), with Superwallproceeds, with Adaptynet_revenue. Converted to euros at the ECB reference rate. - Refunds are reversed at the same rate; with RevenueCat,
REFUND_REVERSEDrestores the booking. - Sandbox purchases are displayed but never billed.
- All purchases reported by your provider count: subscriptions, one-time purchases and consumables. Advertising revenue and the price of a paid download never reach these providers and are not subject to a revenue share. If your app only earns money this way, it isn't a fit for RevReach: with us, the creator always shares in the revenue.
Testing
- RevenueCat: click “Send test event” for the webhook. Adapty: save the integration (verification request). Superwall: make a sandbox purchase. In RevReach, the event appears under Integration → Recent webhook events.
- Make a sandbox purchase with the code
TEST: the code field is then verified (see above). - Only production purchases by real users are booked.
- The examples store the first code permanently on the device and send it again on every launch. After testing with
TEST, reinstall the test app or delete the stored code.
Security and privacy
- Read-only: RevReach only receives events and reads numbers. The RevenueCat key only needs read permissions; RevReach cannot change anything in your account.
- Encrypted: API keys and signing secrets are stored encrypted (AES-256-GCM). Webhook tokens are stored only as a hash and shown exactly once.
- Minimal data: no personal data of your users except a pseudonymous customer ID (app user ID or profile ID) and purchase data (product, price, currency, country, time). Email addresses, advertising IDs or IP addresses that a provider includes in its webhooks are not stored.
- Data processing agreement: we process this data as your processor under the data processing agreement. Add this disclosure to your privacy policy; a suggested wording is provided in the data processing agreement.
- The data is not used for tracking within the meaning of Apple's App Tracking Transparency: no linking with data from other apps, no advertising IDs.
- The creator code does not unlock any features and is not a means of payment. To give users with a code a discount, use the stores' tools (Apple offer codes or promotional offers, Google Play offers).