Skip to content

feat: Add AppsFlyer SDK 7 kit (appsflyer-7) - #748

Open
jamesnrokt wants to merge 1 commit into
mainfrom
feat/appsflyer-7-kit
Open

feat: Add AppsFlyer SDK 7 kit (appsflyer-7)#748
jamesnrokt wants to merge 1 commit into
mainfrom
feat/appsflyer-7-kit

Conversation

@jamesnrokt

Copy link
Copy Markdown
Collaborator

Summary

Adds a new appsflyer-7 kit targeting AppsFlyer Android SDK 7.x, following the existing multi-major kit pattern (braze-38..41).

appsflyer-6 is untouched and stays pinned to [6.17.3,7.0.0), so existing v6 consumers are unaffected — v7 is opt-in.

Why a new kit rather than an upgrade

AppsFlyer 7.0 is a breaking release, and it raises its own minSdk from 19 to 21. Upgrading appsflyer-6 in place would have broken every current consumer, including those on API 19–20.

Breaking changes handled

Verified against the real af-android-sdk 6.17.3 and 7.0.1 artifacts (javap over the extracted classes.jar) rather than the release notes:

Change Handling
com.appsflyer.*com.appsflyer.share.* for AppsFlyerConsent, AppsFlyerConversionListener, AFInAppEventType, AFInAppEventParameterName, deeplink.* Import rewrite. AppsFlyerLib and AppsFlyerProperties did not move.
start(Context) removed start() (2 call sites)
setUserEmails(EmailsCryptType, …) and the EmailsCryptType enum removed setUserEmail(String) (2 call sites)
AppsFlyerConversionListener no longer declares onAppOpenAttribution / onAttributionFailure Overrides removed — both were empty no-ops
AAR minSdk 19 → 21 Kit and example app raised to 21

Event/parameter constants (ADD_TO_CART, PURCHASE, CONTENT_ID, REVENUE, …) and the AppsFlyerConsent 4-arg constructor are unchanged, so the commerce and consent logic needed no edits.

The AppsFlyerConsent unit-test stub moved to com/appsflyer/share/ to keep shadowing the real class; the AppsFlyerLib stub stayed in com.appsflyer because that class did not move.

Validation

  • appsflyer-7:testRelease24/24 pass against real 7.0.1
  • appsflyer-6:testRelease24/24 pass (no regression)
  • ktlintCheck on both kits — pass
  • trunk check — no new issues; 0 issues of any kind in the new kit directory
  • appsflyer-7:example-kotlin:assembleDebug — APK builds; merged manifest is minSdkVersion=21 and the dex contains Lcom/appsflyer/share/*;, confirming v7 links end to end
  • publishToMavenLocal — publishes as com.mparticle:appsflyer-7 with af-android-sdk:[7.0.0,8.0.0) at compile scope; range resolves to 7.0.1

Registered in settings-kits.gradle, settings-kit-examples.gradle and kits/matrix.json, so the kit gets its own CI job running testRelease plus the example build.

Reviewer notes

  • minSdk 21 is forced by the v7 AAR, not a preference. It only affects this new opt-in module; appsflyer-6 still serves API 19–20.
  • The email-hashing option is gone upstream. v7 deleted EmailsCryptType, so the kit can no longer ask AppsFlyer to SHA256 emails. The kit was already passing EmailsCryptType.NONE (plaintext), so the value forwarded is unchanged — but the capability no longer exists.
  • No CHANGELOG entry in this PR, intentionally — happy to add one if you'd prefer it here.
  • com.google.android.play:integrity is not newly introduced; it is already transitive via appsflyer-6 (6.18.1). The only genuinely new transitive is com.appsflyer:af-android-sdk-base.

🤖 Generated with Claude Code

AppsFlyer 7.0 relocated much of its public API and removed several
methods, so v7 support ships as a new side-by-side kit following the
existing multi-major pattern (braze-38..41). appsflyer-6 is untouched
and stays pinned to [6.17.3,7.0.0), so existing v6 consumers are
unaffected and v7 is opt-in.

Changes applied to AppsFlyerKit.kt, verified against the real 6.17.3
and 7.0.1 artifacts rather than the release notes:

- com.appsflyer.* -> com.appsflyer.share.* for AppsFlyerConsent,
  AppsFlyerConversionListener, AFInAppEventType,
  AFInAppEventParameterName and deeplink.*. AppsFlyerLib and
  AppsFlyerProperties did not move.
- start(Context) removed -> start()
- setUserEmails(EmailsCryptType, ...) and the EmailsCryptType enum
  removed -> setUserEmail(String)
- AppsFlyerConversionListener no longer declares onAppOpenAttribution
  or onAttributionFailure; both overrides were empty no-ops
- minSdk 19 -> 21, mandated by the v7 AAR

Event and parameter constants and the AppsFlyerConsent 4-arg
constructor are unchanged, so the commerce and consent logic needed no
edits. The AppsFlyerConsent unit-test stub moved to com/appsflyer/share
to keep shadowing the real class.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jamesnrokt
jamesnrokt requested a review from a team as a code owner July 31, 2026 17:11
@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
New attribution, identity, and GDPR consent forwarding path on a major SDK bump, but behavior is largely ported from appsflyer-6 and adoption is opt-in via a separate artifact.

Overview
Adds a new appsflyer-7 mParticle kit (alongside unchanged appsflyer-6) so apps can opt into AppsFlyer SDK 7.x via com.mparticle:appsflyer-7 and af-android-sdk:[7.0.0,8.0.0), with minSdk 21.

The kit implementation adapts to AppsFlyer 7 breaking API changes: imports for consent, conversion, in-app events, and deeplinks move to com.appsflyer.share.*; AppsFlyerLib.start() is called without a Context (replacing start(context) / start(activity)); email identities use setUserEmail instead of removed setUserEmails(EmailsCryptType, …); and empty onAppOpenAttribution / onAttributionFailure overrides are dropped because they are no longer on the listener interface.

Also included are a Kotlin example app, README migration notes, unit tests (with test stubs under the new package layout), and repo wiring in settings-kits.gradle, settings-kit-examples.gradle, and kits/matrix.json for CI.

Reviewed by Cursor Bugbot for commit 03091b1. Bugbot is set up for automated code reviews on this repo. Configure here.


```groovy
dependencies {
implementation 'com.mparticle:appsflyer-7:5+'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
implementation 'com.mparticle:appsflyer-7:5+'
implementation 'com.mparticle:appsflyer-7:6+'

@@ -0,0 +1,51 @@
# AppsFlyer Kit Integration

This repository contains the [AppsFlyer](https://www.appsflyer.com/) integration for the [mParticle Android SDK](https://github.com/mParticle/mparticle-android-sdk).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This repository contains the [AppsFlyer](https://www.appsflyer.com/) integration for the [mParticle Android SDK](https://github.com/mParticle/mparticle-android-sdk).
This directory contains the [AppsFlyer](https://www.appsflyer.com/) integration for the [mParticle Android SDK](https://github.com/mParticle/mparticle-android-sdk).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants