Skip to main content
Use the Partnero Flutter plugin to tell Partnero which partner referred an app user. After that, any purchase recorded for the user, through RevenueCat or your backend, earns that partner a commission. The Mobile apps guide explains the whole flow.
  • Flutter 3.44+, iOS 15+, Android 7.0 (API 24)+. Works with Swift Package Manager and CocoaPods
  • A thin wrapper around the Swift and Android SDKs, so it behaves the same way on both platforms
  • Uses only your Program ID, never your API key
Source: github.com/partnero/partnero-flutter · Package: pub.dev/packages/partnero

Before you start

In Partnero, open Program settings and turn on Enable mobile app claims in the Tracking for mobile apps section. Until then, every claim fails with PartneroErrorCode.codeNotFound. Copy your Program ID from the program’s Integration page. It’s the same ID as in your PartneroJS snippet.

Install

Configure

Call configure once at launch, before any claim:
The first call records when the app was first opened on this device, which the program’s claim window counts from. Referral links use ?aff= by default. If yours use another parameter, such as ?ref=DANIEL20, pass referralParameter: 'ref'.

Claim a code the user enters

Claim the code when the user enters one. Pass the ID your purchases are reported under, such as the RevenueCat app user ID:
Each user can be linked to one partner only, so the first successful claim is final. With RevenueCat, claim after Purchases.logIn(...), since anonymous IDs are rejected. If a code is used as both a partner’s link key and a promotion code, say which one the user entered:
Save the code on the RevenueCat customer as well. Then a purchase can still be credited to the partner if the claim request was lost:
When a partner app link or a referral link opens your app, pass the Uri on. With the app_links package, which also delivers the link that started the app:
The code is read from partnero_code, or from your referral parameter, such as https://example.com/?aff=DANIEL20. The click ID is read from partnero_click. It returns null without calling Partnero for links with neither. If the user isn’t signed in yet, store the values and claim after sign-in:
With a deep linking provider such as AppsFlyer, Branch or Adjust, read the click from its callback and call Partnero.claimClick(clickId: clickId, appUserId: user.id).

Claim a Google Play install

When the program has no deep link and a Google Play link is set, app links send Android users to Google Play with the code and click ID in the install referrer. Claim it once the user is signed in:
It returns null when the install didn’t come from a partner link, and always on iOS, so you can call it on both platforms. Each install’s referrer is claimed once. If Google Play can’t be reached, or the claim fails because of a rate limit, a server error or the network, the next call tries again. Other refusals, such as an unknown code, are final for that install, so turn on mobile app claims before you release.

Claim results and failures

The claim functions return a ClaimResult with a status: Refusals throw a PartneroException, whose code is one of: The plugin never retries on its own.

Privacy

The plugin sends Partnero the code, the click ID when there is one, the app user ID, the platform and the first launch date. It stores the first launch date and, on Android, whether the install referrer was claimed. It doesn’t read device identifiers. The iOS privacy manifest declares the user ID. List the user ID as collected for App Functionality in your App Store privacy details and Google Play Data safety form if you don’t already.