Add RouteRev to your iOS app
Use the Swift package to record screens, goals and identity, then link RevenueCat purchases.
Install the package
Add the package in Xcode or Package.swift, starting at 0.3.0. It supports iOS 15+ with no package dependencies.
// Xcode → Add Package Dependencies
// https://github.com/alexmorris10x/routerev-swift
.package(url: "https://github.com/alexmorris10x/routerev-swift", from: "0.3.0")Configure and record events
Replace the public ingest key and the example Memex collector endpoint with your product’s configured values. Configure once at launch. Choose the Search Ads option before this call if you need to change it.
Connect the separate event handlers below to actual app actions. Use the same user ID as web; record the configured sign-up goal only after a successful account creation. reset belongs on sign-out and is not a data-deletion command.
import RouteRev
// At launch: configure only.
RouteRev.configure(key: "pk_your_product",
endpoint: URL(string: "https://e.trymemex.com/e")!)// Connect each handler to the matching action in your app.
func didOpenPaywall() {
RouteRev.screen("Paywall")
}
func didCreateAccount(userID: String) {
RouteRev.identify(userID)
RouteRev.goal("sign_up", ["method": "apple"])
}
func didSignIn(userID: String) {
RouteRev.identify(userID)
}
func didSignOut() {
RouteRev.reset()
}Link RevenueCat purchases
Set rr_install_id after configuring RouteRev, so the webhook can link each purchase to the install. Use your own account ID in RevenueCat when one exists. Production nonzero purchases, renewals and refunds are recorded; sandbox events and zero-price trials are excluded. Webhook connection is arranged during early access.
// After RouteRev.configure, link RevenueCat purchases to this install.
Purchases.shared.attribution.setAttributes([
"rr_install_id": RouteRev.installId ?? ""
])Apple Search Ads
On a device, the first-open event carries an AdServices attribution token. RouteRev resolves it into campaign and keyword IDs without IDFA or the ATT prompt; the token itself is not stored. Search Ads attribution is enabled by default and can be turned off.
var options = RouteRev.Options()
options.searchAdsAttribution = false // optional: disable Search Ads attribution
RouteRev.configure(key: "pk_your_product",
endpoint: URL(string: "https://e.trymemex.com/e")!, options: options)Privacy label and collection
Declare Product Interaction and User ID, linked and not used for tracking, in your app’s privacy label. There is no IDFA, fingerprinting or sharing with third parties for tracking. Review the complete label for your app’s other SDKs too.
The install ID is kept in the Keychain and survives reinstall. Setting RouteRev.isEnabled = false stops all events, including first_open (from version 0.3.0). In earlier versions configure still sends first_open, so call configure only after any consent your app requires. App Store campaign downloads remain aggregate counts, not device-to-payment joins.