AppsFlyer Setup Guide for iOS and Android Apps: The Complete & Proven Guide (2026)
A wrong SDK start order, a missing postback setting or a bad event parameter can quietly break your whole attribution pipeline. This AppsFlyer setup guide walks through the full implementation for iOS and Android: account and Dev Key, SDK install and initialization, ATT, events, deep links, ad network connections and testing.One thing changed recently and many tutorials have not caught up: AppsFlyer now ships SDK 7 for iOS and Android, with a different initialization and start flow from SDK 6. This guide follows the SDK 7 documentation, checked in October 2026, and tells you where the old pattern no longer applies. If you are new to the topic, read
what mobile attribution is and how it works first.
What AppsFlyer Does and Why It Matters
AppsFlyer is a Mobile Measurement Partner (MMP). It attributes installs, in-app events and revenue to the campaign, network or creative that drove them, and it sends the results back to your ad networks. Without an MMP you cannot tell which paid channel is working.Pricing is simpler than it used to be. AppsFlyer’s
pricing page lists Zero (free, with 12,000 conversions in the first year, but not suitable for apps with paid activities), Growth (pay as you go, $0.07 per conversion after the first 12,000) and Enterprise (custom). For a vendor comparison, see
AppsFlyer vs Adjust and
Singular vs AppsFlyer.
Before You Start the AppsFlyer Setup
Have these ready:
- Admin access to your AppsFlyer account.
- Access to your app’s source code for both platforms.
- App Store Connect and Google Play Console access.
- Accounts for the ad networks you plan to run.
Step 1: Create Your Account and Add Your Apps
Create your AppsFlyer account, then add each platform as its own app, because iOS and Android have different app identifiers. If you want test traffic kept out of production reports, also create a debug app with its own app ID that is never published to the stores. AppsFlyer’s
integration testing guide describes this approach.
Step 2: Find Your Dev Key
The Dev Key authenticates your app’s data. In the dashboard, go to Settings, then App Settings, then Dev Key Management. By default all apps in an account share one Dev Key, although you can give each app its own. If the key could have been exposed, replace it, and plan a new SDK release because the key is compiled into the app.
Step 3: iOS SDK Setup
Install the SDK
With Swift Package Manager, add one of AppsFlyer’s package repositories in Xcode (File, then Add Packages) and add the
AppsFlyerLib product to your app target. AppsFlyer publishes a static, a dynamic and a strict variant, and the strict one removes IDFA collection, which suits apps aimed at children.
https://github.com/AppsFlyerSDK/AppsFlyerFramework-Static
With CocoaPods:
pod 'AppsFlyerFramework'
The current release was 7.0.3 when I checked. See AppsFlyer’s
iOS SDK 7 install page for the latest options.
Add the ATT Usage Description
If your app will show the ATT prompt, add Apple’s usage description key to Info.plist and write a clear, honest reason for the user.
<key>NSUserTrackingUsageDescription</key>
<string>We use this to measure which ads brought you to the app.</string>
Optional: Postback Copy Endpoint
This replaces the old advice about pasting ad network IDs into your app. The
SKAdNetworkItems list belongs to apps that display ads, not to an app that only advertises itself, as Apple’s
advertised app guide explains. What an advertised app can add is a copy of the winning SKAdNetwork postback. AppsFlyer documents this value for the key:
<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://appsflyer-skadnetwork.com/</string>
AppsFlyer also documents an AdAttributionKit postback copy key with the same URL. Copy it from AppsFlyer’s current instructions, because key names can change. For the wider SKAN picture, see the
SKAdNetwork setup guide.
Initialize and Start (SDK 7)
SDK 7 changed this flow. You initialize with
initialize(devKey:appId:), register a session-ready listener, and call
start() inside it. The old writable
appsFlyerDevKey and
appleAppID properties are read-only now. For SwiftUI, AppsFlyer says to wire an AppDelegate in with
@UIApplicationDelegateAdaptor.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Set debug before other SDK calls, and turn it off before release
AppsFlyerLib.shared().isDebug = false
AppsFlyerLib.shared().initialize(devKey: "YOUR_DEV_KEY", appId: "YOUR_APPLE_APP_ID")
AppsFlyerLib.shared().registerSessionReadyListener {
AppsFlyerLib.shared().start()
}
return true
}
Handle ATT Correctly in SDK 7
This is the biggest change from older tutorials. In SDK 7,
waitForATTUserAuthorization is deprecated and the SDK no longer manages ATT timing. If you do nothing, the SDK sends the initial install data without the IDFA before the user answers. To wait, AppsFlyer’s pattern is to hold two flags, one set by the session-ready listener and one set when the user has answered the prompt, and call
start() only when both are true. The listener fires once per foreground cycle.Remember that SKAdNetwork itself does not require ATT. Apple states that apps can call its attribution APIs regardless of tracking authorization. The wait only matters if you want the IDFA for users who allow tracking. Read AppsFlyer’s
iOS SDK 7 migration guide for the exact pattern, and ask the prompt at a moment where the value to the user is clear.
Step 4: Android SDK Setup
Add the Dependencies
SDK 7 raises the minimum Android SDK level from 19 to 21 and requires Kotlin 2.0 or higher if you are on 1.9. AppsFlyer recommends its BOM. Replace the placeholder with the latest version listed on Maven Central.
dependencies {
implementation platform("com.appsflyer:af-android-sdk-bom:SDK_VERSION")
implementation "com.appsflyer:af-android-sdk"
implementation "com.android.installreferrer:installreferrer:2.2"
}
If you are migrating from SDK 6, remove the
SingleInstallBroadcastReceiver and
MultipleInstallBroadcastReceiver entries from your manifest, or the manifest merge will break.
Manifest Permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
AppsFlyer notes that the SDK adds the
AD_ID permission automatically from version 6.8.0, so you no longer declare it yourself on current versions.
Initialize and Start (SDK 7)
Initialize in your Application class, not in an Activity. Pass
null as the second argument if you do not need conversion data. The conversion listener class moved to
com.appsflyer.share in SDK 7 if you do use it.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
AppsFlyerLib.getInstance().setDebugLog(false)
AppsFlyerLib.getInstance().init("YOUR_DEV_KEY", null, this)
AppsFlyerLib.getInstance().registerSessionReadyListener {
AppsFlyerLib.getInstance().start()
}
}
}
If you need to wait for a consent flow before starting, AppsFlyer documents the same two-condition pattern, with a warning that the session-ready callback runs on a background thread, so shared flags must be thread safe. See the
Android SDK 7 integration page and the
migration guide.
Step 5: Track In-App Events
Events are the core of your attribution data. Log the actions that matter to your business, and use AppsFlyer’s predefined names where they fit.
iOS
// Registration
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [AFEventParamRegistrationMethod: "email"])
// Purchase
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 29.99,
AFEventParamCurrency: "USD",
AFEventParamReceiptId: "order_12345",
AFEventParamContentId: "premium_plan"
])
Android
val purchaseValues = HashMap<String, Any>()
purchaseValues[AFInAppEventParameterName.REVENUE] = 29.99
purchaseValues[AFInAppEventParameterName.CURRENCY] = "USD"
purchaseValues[AFInAppEventParameterName.RECEIPT_ID] = "order_12345"
purchaseValues[AFInAppEventParameterName.CONTENT_ID] = "premium_plan"
AppsFlyerLib.getInstance().logEvent(applicationContext, AFInAppEventType.PURCHASE, purchaseValues)
Follow these rules from AppsFlyer’s documentation:
- Revenue is a plain number with no currency symbol, commas or text.
- Currency is a three-letter ISO 4217 code, and it defaults to USD if you leave it out.
- Do not start custom event names with
af_. - Events logged before
start are cached, and the cache holds up to 40 events. - If you use AppsFlyer’s ROI360 product, avoid the revenue parameter on events to prevent double counted revenue.
See AppsFlyer’s pages on
sending events on iOS and
on Android for the full lists of event and parameter names.
Set the Customer User ID
If you want to tie events to your own user ID, set it every launch. On iOS SDK 7, set
AppsFlyerLib.shared().customerUserID inside the session-ready callback before
start(). On Android SDK 7, call
setCustomerUserId() before
start(). AppsFlyer notes that events tagged with this ID can be cross-referenced with user data from other devices and apps, so treat it with care.
Step 6: Set Up OneLink Deep Linking
OneLink is AppsFlyer’s deep linking solution, covering deferred deep links for new installs and direct deep links for existing users. Create a OneLink template in the dashboard with your app identifiers, and set fallback URLs for desktop users.On iOS, add your OneLink domain under Associated Domains in Xcode as an
applinks: entry, using the domain AppsFlyer gives you. Then pass incoming links to the SDK. AppsFlyer documents the
continue call for Universal Links and the
handleOpen call for URI schemes, plus a deep link delegate that returns found, not found or failure results.
.onOpenURL { url in
AppsFlyerLib.shared().handleOpen(url, options: [:])
}
.onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { activity in
AppsFlyerLib.shared().continue(activity, restorationHandler: nil)
}
On Android, register an App Links intent filter for your OneLink domain with
autoVerify enabled.
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="yourapp.onelink.me" />
</intent-filter>
In SDK 7 the old app-open attribution callbacks were removed in favor of the deep link delegate, so use that path for both platforms. If deep link attribution looks wrong later, the
mobile attribution audit covers deep link checks.
Step 7: Connect Your Ad Networks
For each network you run, enable and configure its integration in the AppsFlyer dashboard, in the integrated partners area. Menu names change, so look for the partner marketplace or integrated partners section rather than a fixed path. For every network:
- Enable the integration and enter the credentials or IDs it asks for.
- Review the click and view attribution windows instead of leaving defaults you never checked.
- Turn on the postbacks you need back to the network, such as in-app events used for optimization.
For Meta on iOS, make sure your Aggregated Event Measurement priorities line up with the events you send. For Google Ads, confirm the conversion import is working after you map events.
Step 8: Validate Your AppsFlyer Setup
Do not assume it works. AppsFlyer’s integration testing flow is simple: create an attribution link to simulate an ad click, install the app on a registered test device, then inspect the conversion data. Use a debug app so test traffic stays out of production reports.Work through this checklist to finish the AppsFlyer setup guide properly:
- An install event fires on a fresh install.
- Custom events appear with the right names and parameters.
- Revenue events show the correct amount and currency.
- Deep links open the right screen, including after a fresh install.
- SKAdNetwork postbacks start arriving once Apple’s delays have passed.
- Ad network integrations show data.
The free
mobile app attribution debugger checks a single payload against documented rules, and the
iOS attribution fix guide helps if iOS numbers still look wrong.
Common AppsFlyer Setup Mistakes
- Using SDK 6 patterns on SDK 7. Direct property assignment for the Dev Key and Apple ID, and starting without the session-ready listener, no longer apply.
- Not waiting for ATT on iOS SDK 7. Without your own wait, the install goes out without the IDFA before the user answers.
- Skipping the debug app. Test events mixed with production data are hard to clean up, so use a separate debug app.
- Forgetting the currency. A missing currency defaults to USD, so non-USD revenue looks wrong.
- Leaving debug logging on. AppsFlyer warns to disable debug logs before distribution to avoid leaking sensitive information.
- Treating the Info.plist ID list as required. Network IDs belong in apps that display ads, not in an app that only advertises itself.
Flutter, React Native and Other Frameworks
AppsFlyer’s framework plugins wrap the native SDKs, and the v7 plugins changed their own API. The Flutter plugin on pub.dev, for example, wraps iOS SDK 7.0.2 and Android SDK 7.0.1 and uses an
AppsFlyerSdk.instance entry point with
init(devKey, appId). The version I saw listed was a release candidate, so check which release is stable before you adopt it, and follow the plugin’s own migration guide. I left framework code out on purpose, because it differs between plugin versions.
FAQ
How do I find my AppsFlyer Dev Key?
In the AppsFlyer dashboard, go to Settings, then App Settings, then Dev Key Management. By default all apps in an account share one Dev Key, though you can give each app its own. If the key may have been exposed, replace it, and remember that a new key needs a new SDK release.
Do I need a separate AppsFlyer account for iOS and Android?
No. One account can hold both apps. Add iOS and Android as separate apps, because they have different app identifiers, and use the same account for reporting and ad network integrations.
How long does it take for AppsFlyer data to appear?
Install and event data from your SDK can show up quickly, but some reports update on a schedule. SKAdNetwork data is slower, because Apple sends postbacks after a conversion window closes and adds a random delay, so allow a day or more before you judge it.
Is AppsFlyer free to use?
AppsFlyer lists a free Zero plan with 12,000 conversions in the first year, but it states the plan is not suitable for apps with paid activities. The Growth plan lists $0.07 per conversion after the first 12,000, and Enterprise is custom priced. Confirm current terms on the pricing page before you plan a budget.
What is the difference between AppsFlyer and Firebase Analytics?
AppsFlyer attributes installs and in-app events to the ad campaign that drove them. Firebase Analytics measures what users do inside your app. Many apps use both, because they answer different questions.
How do I track in-app purchases in AppsFlyer?
Log the purchase event with the revenue as a plain number, a three-letter ISO currency code and a unique receipt or order ID. Do not add currency symbols to the revenue value, and note that the currency defaults to USD if you leave it out.
Do I need to change my code for AppsFlyer SDK 7?
Yes, if you are upgrading from SDK 6. SDK 7 changes how you initialize and start the SDK on both platforms, and on iOS it no longer manages the ATT wait for you. Follow AppsFlyer’s migration guides before you update the dependency.If you want help getting your AppsFlyer setup right, send your platform and a short description to
contact@alfahadhridoy.com and I will reply by email.