From 66d387b504074e80aa0f98039f34fe54d08b456f Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Tue, 24 Nov 2026 16:02:24 +0200 Subject: [PATCH 1/9] fix(android): re-enable Purchase Connector dependency (DELIVERY-137580) purchase-connector:2.3.0 was commented out in AppsFlyerDependencies.xml on the assumption that AGP 8 hard-fails on its manifest-package collision with af-android-sdk (both "com.appsflyer") and that android.uniquePackageNames does not help. Both were wrong: AGP 8.x only warns, and AGP 9.0 turns the warning into an error by flipping android.uniquePackageNames to true, so setting it back to false is the opt-out. With the dependency disabled, Android Purchase Connector calls were no-ops for every integrator. - Re-enable com.appsflyer:purchase-connector:2.3.0 in AppsFlyerDependencies.xml. - test-app: set android.uniquePackageNames=false in gradleTemplate.properties and enable the custom Gradle properties template so it is actually applied. - README: replace the incorrect AGP 8 note with AGP 9 guidance. - AppsFlyerPurchaseConnector: keep the missing-class guard, update the comment and warning text that claimed the dependency was disabled. - CHANGELOG: Unreleased entry. Co-Authored-By: Claude Opus 5.5 --- .../AppsFlyer/AppsFlyerPurchaseConnector.cs | 19 +++++++++---------- .../Editor/AppsFlyerDependencies.xml | 7 ++++--- CHANGELOG.md | 7 +++++++ README.md | 5 ++++- .../Plugins/Android/gradleTemplate.properties | 12 +++--------- .../ProjectSettings/ProjectSettings.asset | 2 +- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs b/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs index 3ccb744e..2a70b064 100644 --- a/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs +++ b/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs @@ -246,12 +246,11 @@ private void Awake() private static bool _connectorUnavailableWarned; private static bool _connectorLookupFailed; - // purchase-connector is currently disabled in AppsFlyerDependencies.xml (AGP 8 namespace - // collision with af-android-sdk - see review_processed.md #16), but AppsFlyerAndroidWrapper - // still directly imports its types. That turns every Purchase Connector call below into an - // unguarded NoClassDefFoundError/ClassNotFoundException at the point of first use instead of - // a build-time failure. Resolve/call through here so integrators who don't use Purchase - // Connector are unaffected, and those who do get one clear logged warning instead of a crash. + // AppsFlyerAndroidWrapper imports purchase-connector types, but the wrapper only has a + // compileOnly dependency on it. If the app ends up without purchase-connector (e.g. the + // dependency was excluded or EDM4U resolution was skipped), every call below would throw + // NoClassDefFoundError/ClassNotFoundException at first use. Resolve/call through here so the + // app gets one clear logged warning instead of a crash. private static bool TryGetConnector(out AndroidJavaClass connector) { if (_connectorLookupFailed) @@ -294,10 +293,10 @@ private static void WarnConnectorUnavailable(Exception e) { if (_connectorUnavailableWarned) return; _connectorUnavailableWarned = true; - Debug.LogWarning("[AppsFlyer] Purchase Connector is unavailable on Android (the " + - "purchase-connector dependency is currently disabled due to an AGP 8 namespace " + - "collision with af-android-sdk - see Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml). " + - "Purchase Connector calls will be no-ops until this is resolved upstream. " + e); + Debug.LogWarning("[AppsFlyer] Purchase Connector is unavailable on Android: " + + "com.appsflyer:purchase-connector is missing from the build. Make sure External " + + "Dependency Manager resolved Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml. " + + "Purchase Connector calls will be no-ops. " + e); } #endif diff --git a/Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml b/Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml index 87eb7baa..76f9564e 100644 --- a/Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml +++ b/Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml @@ -10,9 +10,10 @@ itself is installed on the device, surfacing as a ClassNotFoundException in the "gaidError" field of outgoing SDK requests. --> - - + + + AGP 8.x only warns about it; AGP 9+ fails the build unless android.uniquePackageNames=false, + which AppsFlyerGradlePropertiesProcessor adds to the generated gradle.properties. --> diff --git a/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs new file mode 100644 index 00000000..2696e10b --- /dev/null +++ b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs @@ -0,0 +1,59 @@ +#if UNITY_ANDROID && !APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX +using System.IO; +using UnityEditor.Android; +using UnityEngine; + +namespace AppsFlyerSDK +{ + // com.appsflyer:purchase-connector and com.appsflyer:af-android-sdk share the manifest + // package "com.appsflyer". AGP 8.x only warns about it, but AGP 9.0 changed the default of + // android.uniquePackageNames to true, which turns it into a build error. This adds + // android.uniquePackageNames=false to the generated gradle.properties so that apps building + // with AGP 9+ (Unity 6000.0.79f1+, 6000.3.17f1+, ...) don't have to set it by hand. + // + // The property is only added when the project doesn't already set it, so an explicit + // value in gradleTemplate.properties always wins. Define the scripting symbol + // APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX to turn this off entirely. + public class AppsFlyerGradlePropertiesProcessor : IPostGenerateGradleAndroidProject + { + private const string PropertyKey = "android.uniquePackageNames"; + + public int callbackOrder => 0; + + public void OnPostGenerateGradleAndroidProject(string path) + { + // path points to the unityLibrary module; gradle.properties lives in the root project. + string propertiesPath = Path.GetFullPath(Path.Combine(path, "..", "gradle.properties")); + if (!File.Exists(propertiesPath)) + { + Debug.LogWarning("[AppsFlyer] gradle.properties not found at " + propertiesPath + + ". If the build fails with \"Namespace 'com.appsflyer' is used in multiple modules\", add " + + PropertyKey + "=false to Assets/Plugins/Android/gradleTemplate.properties."); + return; + } + + string contents = File.ReadAllText(propertiesPath); + if (DefinesProperty(contents, PropertyKey)) return; + + string separator = contents.Length == 0 || contents.EndsWith("\n") ? "" : "\n"; + File.AppendAllText(propertiesPath, separator + + "# Added by AppsFlyer: purchase-connector and af-android-sdk share the namespace com.appsflyer (AGP 9+).\n" + + PropertyKey + "=false\n"); + } + + private static bool DefinesProperty(string contents, string key) + { + foreach (string rawLine in contents.Split('\n')) + { + string line = rawLine.Trim(); + if (line.Length == 0 || line[0] == '#' || line[0] == '!') continue; + + int end = line.IndexOfAny(new[] { '=', ':', ' ', '\t' }); + string lineKey = end < 0 ? line : line.Substring(0, end); + if (lineKey == key) return true; + } + return false; + } + } +} +#endif diff --git a/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs.meta b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs.meta new file mode 100644 index 00000000..f0d3c4d7 --- /dev/null +++ b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44758d297d364bbeb6008c83710df6de +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa4e72a..88c9f8fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,10 @@ * **Fix (DELIVERY-137580):** Android Purchase Connector is enabled again. `com.appsflyer:purchase-connector:2.3.0` had been commented out in `AppsFlyerDependencies.xml` because of a manifest-package collision with `af-android-sdk` (both `com.appsflyer`), so Purchase Connector calls on Android were no-ops. AGP 8.x - only warns about the collision. AGP 9+ fails the build unless `android.uniquePackageNames=false` is - set in `gradleTemplate.properties` (see README). + only warns about the collision; AGP 9+ fails the build unless `android.uniquePackageNames=false` is set. + The plugin now adds `android.uniquePackageNames=false` to the generated `gradle.properties` at build + time (new `AppsFlyerGradlePropertiesProcessor`), unless the project already sets the property. Define + `APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX` to opt out (see README). ## v7.0.41 * **Fix (DELIVERY-135217):** `AFMiniJSON` formatted and parsed numbers using the device's current diff --git a/README.md b/README.md index 2eaf086a..729282b6 100755 --- a/README.md +++ b/README.md @@ -86,10 +86,7 @@ Use the last **6.17.x** dual-line release: **`v6.17.90`** (Billing v7) or **`v6. - If you were previously using the standalone Purchase Connector from a separate repository, simply remove any references to `using AppsFlyerConnector;` from your codebase, as its functionality is now included in the main plugin under the `AppsFlyerSDK` namespace. - The Purchase Connector now supports **StoreKit 2** for iOS 15+ alongside the existing StoreKit 1 support. - For detailed migration instructions and new features, see our [Purchase Connector documentation](/docs/purchase-connector.md). -- **Android + AGP 9**: `com.appsflyer:purchase-connector` and `com.appsflyer:af-android-sdk` share the manifest package `com.appsflyer`. AGP 8.x only logs a warning (`Namespace 'com.appsflyer' is used in multiple modules and/or libraries`). AGP 9.0 changed the default of `android.uniquePackageNames` to `true`, which turns this into a build error. If your project builds with AGP 9+, add the following to `Assets/Plugins/Android/gradleTemplate.properties` (enable **Custom Gradle Properties Template** in Player Settings > Publishing Settings): - ```properties - android.uniquePackageNames=false - ``` +- **Android + AGP 9**: `com.appsflyer:purchase-connector` and `com.appsflyer:af-android-sdk` share the manifest package `com.appsflyer`. AGP 8.x only logs a warning (`Namespace 'com.appsflyer' is used in multiple modules and/or libraries`), but AGP 9.0 changed the default of `android.uniquePackageNames` to `true`, which turns it into a build error. The plugin handles this for you: at build time it adds `android.uniquePackageNames=false` to the generated `gradle.properties`, unless your project already sets that property. To opt out, add the scripting define symbol `APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX` and set the property yourself in `Assets/Plugins/Android/gradleTemplate.properties` (enable **Custom Gradle Properties Template** in Player Settings > Publishing Settings). --- ## ❗❗ Breaking changes when updating to 6.17.5 ❗❗ diff --git a/test-app/Assets/Plugins/Android/gradleTemplate.properties b/test-app/Assets/Plugins/Android/gradleTemplate.properties index 1e8d1757..c8a36b4e 100644 --- a/test-app/Assets/Plugins/Android/gradleTemplate.properties +++ b/test-app/Assets/Plugins/Android/gradleTemplate.properties @@ -3,6 +3,3 @@ org.gradle.jvmargs=-Xmx4096M android.useAndroidX=true android.enableJetifier=true **ADDITIONAL_PROPERTIES** -# purchase-connector and af-android-sdk both use the manifest package "com.appsflyer". -# AGP 8.x only warns about it; AGP 9 makes it a build error unless this flag is false. -android.uniquePackageNames=false From 6e301745faa2d27a713efa0e3d81944ecd2dd1c3 Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Wed, 25 Nov 2026 15:35:41 +0200 Subject: [PATCH 3/9] test(e2e): cover Android Purchase Connector integration (DELIVERY-137580) DELIVERY-137580 went unnoticed because nothing in E2E exercised Purchase Connector: with purchase-connector commented out of AppsFlyerDependencies.xml the C# guard turned every call into a no-op and all checks still passed. - test-app: QATestScript initialises Purchase Connector (init, build, startObservingTransactions) before start() on Android. TestAppDependencies.xml adds Play Billing 8.0.0, which purchase-connector only declares compileOnly. - test-plan: new Android-only phase_8 (E2E-008). It requires the native "[PurchaseConnector]: Start Observing Transactions" and onBillingSetupFinished logs and fails on the guard's "Purchase Connector is unavailable" warning, NoClassDefFoundError or FATAL. - rc-e2e-android: APK verification fails the job if com/appsflyer/api/PurchaseClient is missing from the dex. Local run on an API 35 Play Store emulator with an APK built on Unity 6000.3.5f1 (CI version): 43/43 checks passed across phase_1-6 and phase_8. Co-Authored-By: Claude Opus 5.5 --- .af-e2e/test-plan.json | 50 ++++++++++++++++++- .github/workflows/rc-e2e-android.yml | 7 +++ .../Assets/Editor/TestAppDependencies.xml | 9 ++++ .../Editor/TestAppDependencies.xml.meta | 7 +++ test-app/Assets/Scripts/QATestScript.cs | 35 ++++++++++++- 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 test-app/Assets/Editor/TestAppDependencies.xml create mode 100644 test-app/Assets/Editor/TestAppDependencies.xml.meta diff --git a/.af-e2e/test-plan.json b/.af-e2e/test-plan.json index ac286ee5..25214894 100644 --- a/.af-e2e/test-plan.json +++ b/.af-e2e/test-plan.json @@ -3,10 +3,10 @@ "plan_id": "unity-e2e", "plugin": "unity", "version": "1.0.0", - "description": "End-to-end test plan for the AppsFlyer Unity plugin. CI imports the generated appsflyer-unity-plugin-.unitypackage into test-app/ before building, so E2E validates the same regular customer artifact that RC publish attaches. Covers seven scenarios: cold launch, background deep link, foreground deep link, custom event with parameters, identity APIs round-trip, consent / SDK stop toggle, and (iOS-only) Universal Link re-open through the scene delegate's scene:continueUserActivity:. NOTE: the scene delegate's true cold-launch path (scene:willConnectToSession:options:, DELIVERY-115275's original trigger) is NOT exercised by phase_7 or any other automation here - UISceneConnectionOptions has no public initializer, so the QA harness cannot fabricate that event and can only drive the warm re-open swizzle. That branch remains manually/E2E-unverified. Mapped to E2E-001..E2E-007 in appsflyer-mobile-plugin-tooling/contracts/e2e-test-contract.md.", + "description": "End-to-end test plan for the AppsFlyer Unity plugin. CI imports the generated appsflyer-unity-plugin-.unitypackage into test-app/ before building, so E2E validates the same regular customer artifact that RC publish attaches. Covers eight scenarios: cold launch, background deep link, foreground deep link, custom event with parameters, identity APIs round-trip, consent / SDK stop toggle, (iOS-only) Universal Link re-open through the scene delegate's scene:continueUserActivity:, and (Android-only) Purchase Connector integration. NOTE: the scene delegate's true cold-launch path (scene:willConnectToSession:options:, DELIVERY-115275's original trigger) is NOT exercised by phase_7 or any other automation here - UISceneConnectionOptions has no public initializer, so the QA harness cannot fabricate that event and can only drive the warm re-open swizzle. That branch remains manually/E2E-unverified. Mapped to E2E-001..E2E-008 in appsflyer-mobile-plugin-tooling/contracts/e2e-test-contract.md.", "platforms": ["android", "ios"], "schema_version": "1.0.0", - "tooling_contract_ref": "E2E-001, E2E-002, E2E-003, E2E-004, E2E-005, E2E-006, E2E-007" + "tooling_contract_ref": "E2E-001, E2E-002, E2E-003, E2E-004, E2E-005, E2E-006, E2E-007, E2E-008" }, "config": { @@ -435,6 +435,52 @@ "fail_action": "fail" } ] + }, + { + "id": "phase_8", + "name": "Purchase Connector integration (Android)", + "scenario_ref": "E2E-008", + "description": "Android-only. Fresh install. The test app calls AppsFlyerPurchaseConnector init/build/startObservingTransactions before start(). Verifies com.appsflyer:purchase-connector is in the APK and actually starts: the native SDK logs Start Observing Transactions and the Play Billing connection callback, and the C# guard did not fall back to no-ops. Regression guard for DELIVERY-137580, where the dependency was commented out of AppsFlyerDependencies.xml and Purchase Connector silently did nothing. No purchase is made; the CI emulator has no Google account, so onBillingSetupFinished reports billing unavailable, which is expected.", + "platforms": ["android"], + "requires_fresh_install": true, + "wait_after_launch_sec": 240, + "checks": [ + { + "id": "pc_csharp_calls_done", + "description": "Test app ran the Purchase Connector setup calls", + "type": "log_contains", + "pattern": "[AF_QA][PurchaseConnector] init+build+startObservingTransactions done", + "fail_action": "fail" + }, + { + "id": "pc_native_observing", + "description": "Native Purchase Connector started observing transactions (proves purchase-connector is in the APK)", + "type": "log_contains", + "pattern": "[PurchaseConnector]: Start Observing Transactions", + "fail_action": "fail" + }, + { + "id": "pc_billing_setup_finished", + "description": "Purchase Connector connected to Play Billing (the callback fires even when billing is unavailable)", + "type": "log_contains", + "pattern": "[PurchaseConnector]: onBillingSetupFinished", + "fail_action": "fail" + }, + { + "id": "pc_not_missing", + "description": "C# guard did not report a missing purchase-connector dependency", + "type": "absent", + "patterns": ["Purchase Connector is unavailable on Android", "NoClassDefFoundError"], + "fail_action": "fail" + }, + { + "id": "no_fatal_errors", + "description": "No fatal exceptions", + "type": "absent", + "patterns": ["Fatal Exception", "FATAL"], + "fail_action": "fail" + } + ] } ], diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index b00bad9f..a9cd126a 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -147,6 +147,13 @@ jobs: echo "::error::AppsFlyerRpcHandler class missing from built APK (af-android-plugin-bridge dependency likely dropped from mainTemplate.gradle)" exit 1 fi + echo "--- Purchase Connector PurchaseClient class present in dex? ---" + if strings "$WORKDIR"/classes*.dex | grep -q 'Lcom/appsflyer/api/PurchaseClient;'; then + echo "FOUND" + else + echo "::error::PurchaseClient class missing from built APK (com.appsflyer:purchase-connector dropped from AppsFlyerDependencies.xml or not resolved by EDM4U)" + exit 1 + fi echo "--- distinct com.appsflyer.* package roots baked into dex ---" strings "$WORKDIR"/classes*.dex | grep -oE '^Lcom/appsflyer/[a-zA-Z_]+' | sort -u diff --git a/test-app/Assets/Editor/TestAppDependencies.xml b/test-app/Assets/Editor/TestAppDependencies.xml new file mode 100644 index 00000000..2207df4f --- /dev/null +++ b/test-app/Assets/Editor/TestAppDependencies.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/test-app/Assets/Editor/TestAppDependencies.xml.meta b/test-app/Assets/Editor/TestAppDependencies.xml.meta new file mode 100644 index 00000000..8c18f493 --- /dev/null +++ b/test-app/Assets/Editor/TestAppDependencies.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0e01d4c5fa71e48f2a47ef124380b97a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/test-app/Assets/Scripts/QATestScript.cs b/test-app/Assets/Scripts/QATestScript.cs index f16ce896..b548a97a 100644 --- a/test-app/Assets/Scripts/QATestScript.cs +++ b/test-app/Assets/Scripts/QATestScript.cs @@ -8,7 +8,7 @@ using AppsFlyerSDK; using System.Text; -public class QATestScript : MonoBehaviour, IAppsFlyerConversionData +public class QATestScript : MonoBehaviour, IAppsFlyerConversionData, IAppsFlyerPurchaseValidation { [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] static void AutoInit() @@ -294,9 +294,42 @@ void RunPreStartApis() AppsFlyer.setAdditionalData(additionalData); AFQALogger.Log("[AF_QA][setAdditionalData] tenant=qa_eu experiment=rc_pipeline_v1"); + SetupPurchaseConnector(); + AFQALogger.Log("[AF_QA][AUTO_APIS] --- Pre-start auto APIs complete ---"); } + // ── Purchase Connector (Android) ────────────────────────────────────────── + + // Must run before AppsFlyer.start(). Billing comes from Assets/Editor/TestAppDependencies.xml. + // E2E phase_8 checks the native "[PurchaseConnector]: Start Observing Transactions" log that + // this produces; if purchase-connector is missing from the APK the C# guard turns these calls + // into no-ops and logs "Purchase Connector is unavailable on Android" instead. + void SetupPurchaseConnector() + { +#if UNITY_ANDROID && !UNITY_EDITOR + AppsFlyerPurchaseConnector.init(this, Store.GOOGLE); + AppsFlyerPurchaseConnector.setIsSandbox(true); + AppsFlyerPurchaseConnector.setAutoLogPurchaseRevenue( + AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions, + AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsInAppPurchases); + AppsFlyerPurchaseConnector.setPurchaseRevenueValidationListeners(true); + AppsFlyerPurchaseConnector.build(); + AppsFlyerPurchaseConnector.startObservingTransactions(); + AFQALogger.Log("[AF_QA][PurchaseConnector] init+build+startObservingTransactions done"); +#endif + } + + public void didReceivePurchaseRevenueValidationInfo(string validationInfo) + { + AFQALogger.Log("[AF_QA][PurchaseConnector] validation info: " + validationInfo); + } + + public void didReceivePurchaseRevenueError(string error) + { + AFQALogger.Log("[AF_QA][PurchaseConnector] validation error: " + error); + } + // ── Post-start APIs ─────────────────────────────────────────────────────── async void LogSdkVersion() From 77a2cedb8d772cd492c8bea29652a31efd7ecb49 Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Wed, 25 Nov 2026 16:02:19 +0200 Subject: [PATCH 4/9] test(e2e): cover iOS Purchase Connector integration (DELIVERY-137580) When PurchaseConnector isn't linked, AppsFlyeriOSWrapper.mm compiles silent no-op stubs, so a missing iOS Purchase Connector would go unnoticed the same way the Android one did. - test-app: QATestScript also sets up Purchase Connector on iOS (setStoreKitVersion(SK2) in addition to the Android calls). - test-plan: new iOS-only phase_9 (E2E-009). It requires the native "[PurchaseConnector] AppsFlyerARS has been set to Sandbox environment" and "Resolved cached PurchaseConnectorEvents" logs and fails on "Library not loaded", "unrecognized selector" or FATAL. - af-scenario-runner: iOS log collection passes --info to `log show`. The AppsFlyer SDK logs at os_log Info level, which `log show` drops by default, so no native SDK line ever reached the checks. None of the existing absent patterns match the extra Info lines. - rc-e2e-ios: new step fails the job if PurchaseConnector.framework is not embedded or UnityFramework does not reference the PurchaseConnector class (i.e. the wrapper was compiled with the stubs). Avoids grep -q so the check stays correct under pipefail. Local run on an iPhone 16 Pro / iOS 18.6 simulator (Unity 6000.5.6f1, Xcode 27, SPM): 48/48 checks passed across phase_1-7 and phase_9; the new workflow step passes against the built .app. Co-Authored-By: Claude Opus 5.5 --- .af-e2e/test-plan.json | 50 ++++++++++++++++++++++++- .github/workflows/rc-e2e-ios.yml | 17 +++++++++ scripts/af-scenario-runner.sh | 4 +- test-app/Assets/Scripts/QATestScript.cs | 21 +++++++---- 4 files changed, 82 insertions(+), 10 deletions(-) diff --git a/.af-e2e/test-plan.json b/.af-e2e/test-plan.json index 25214894..36f867c7 100644 --- a/.af-e2e/test-plan.json +++ b/.af-e2e/test-plan.json @@ -3,10 +3,10 @@ "plan_id": "unity-e2e", "plugin": "unity", "version": "1.0.0", - "description": "End-to-end test plan for the AppsFlyer Unity plugin. CI imports the generated appsflyer-unity-plugin-.unitypackage into test-app/ before building, so E2E validates the same regular customer artifact that RC publish attaches. Covers eight scenarios: cold launch, background deep link, foreground deep link, custom event with parameters, identity APIs round-trip, consent / SDK stop toggle, (iOS-only) Universal Link re-open through the scene delegate's scene:continueUserActivity:, and (Android-only) Purchase Connector integration. NOTE: the scene delegate's true cold-launch path (scene:willConnectToSession:options:, DELIVERY-115275's original trigger) is NOT exercised by phase_7 or any other automation here - UISceneConnectionOptions has no public initializer, so the QA harness cannot fabricate that event and can only drive the warm re-open swizzle. That branch remains manually/E2E-unverified. Mapped to E2E-001..E2E-008 in appsflyer-mobile-plugin-tooling/contracts/e2e-test-contract.md.", + "description": "End-to-end test plan for the AppsFlyer Unity plugin. CI imports the generated appsflyer-unity-plugin-.unitypackage into test-app/ before building, so E2E validates the same regular customer artifact that RC publish attaches. Covers nine scenarios: cold launch, background deep link, foreground deep link, custom event with parameters, identity APIs round-trip, consent / SDK stop toggle, (iOS-only) Universal Link re-open through the scene delegate's scene:continueUserActivity:, and Purchase Connector integration (Android-only phase_8, iOS-only phase_9). NOTE: the scene delegate's true cold-launch path (scene:willConnectToSession:options:, DELIVERY-115275's original trigger) is NOT exercised by phase_7 or any other automation here - UISceneConnectionOptions has no public initializer, so the QA harness cannot fabricate that event and can only drive the warm re-open swizzle. That branch remains manually/E2E-unverified. Mapped to E2E-001..E2E-009 in appsflyer-mobile-plugin-tooling/contracts/e2e-test-contract.md.", "platforms": ["android", "ios"], "schema_version": "1.0.0", - "tooling_contract_ref": "E2E-001, E2E-002, E2E-003, E2E-004, E2E-005, E2E-006, E2E-007, E2E-008" + "tooling_contract_ref": "E2E-001, E2E-002, E2E-003, E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-009" }, "config": { @@ -481,6 +481,52 @@ "fail_action": "fail" } ] + }, + { + "id": "phase_9", + "name": "Purchase Connector integration (iOS)", + "scenario_ref": "E2E-009", + "description": "iOS-only. Fresh install. The test app calls AppsFlyerPurchaseConnector init, setStoreKitVersion(SK2), setIsSandbox(true), build and startObservingTransactions before start(). Verifies the PurchaseConnector framework is linked and actually runs: when it is not linked, AppsFlyeriOSWrapper.mm compiles silent no-op stubs, so the native [PurchaseConnector] logs are the only proof. No purchase is made; the simulator has no App Store account, so StoreKit reports 'No active account', which is expected.", + "platforms": ["ios"], + "requires_fresh_install": true, + "wait_after_launch_sec": 240, + "checks": [ + { + "id": "pc_csharp_calls_done", + "description": "Test app ran the Purchase Connector setup calls", + "type": "log_contains", + "pattern": "[AF_QA][PurchaseConnector] init+build+startObservingTransactions done", + "fail_action": "fail" + }, + { + "id": "pc_native_sandbox", + "description": "Native PurchaseConnector received setIsSandbox(true) (proves the real framework, not the wrapper stubs, ran)", + "type": "log_contains", + "pattern": "[PurchaseConnector] AppsFlyerARS has been set to Sandbox environment", + "fail_action": "fail" + }, + { + "id": "pc_native_cache_resolved", + "description": "Native PurchaseConnector initialised its purchase event cache", + "type": "log_contains", + "pattern": "[PurchaseConnector] Resolved cached PurchaseConnectorEvents", + "fail_action": "fail" + }, + { + "id": "pc_linked", + "description": "No missing framework or selector errors", + "type": "absent", + "patterns": ["Library not loaded", "unrecognized selector"], + "fail_action": "fail" + }, + { + "id": "no_fatal_errors", + "description": "No fatal exceptions", + "type": "absent", + "patterns": ["Fatal Exception", "FATAL"], + "fail_action": "fail" + } + ] } ], diff --git a/.github/workflows/rc-e2e-ios.yml b/.github/workflows/rc-e2e-ios.yml index 80a93478..cad23d2d 100644 --- a/.github/workflows/rc-e2e-ios.yml +++ b/.github/workflows/rc-e2e-ios.yml @@ -274,6 +274,23 @@ jobs: rm -rf test-app/Build/iOS-Simulator/UnityQATest.app cp -R "$APP" test-app/Build/iOS-Simulator/UnityQATest.app + - name: Verify Purchase Connector is linked into the .app + run: | + APP=test-app/Build/iOS-Simulator/UnityQATest.app + if [[ ! -d "$APP/Frameworks/PurchaseConnector.framework" ]]; then + echo "::error::PurchaseConnector.framework is not embedded in UnityQATest.app (PurchaseConnector pod/SPM package not resolved from AppsFlyerDependencies.xml)" + exit 1 + fi + # AppsFlyeriOSWrapper.mm compiles silent no-op stubs when PurchaseConnector-Swift.h is + # not found, so the embedded framework alone is not enough: the real bridge references + # the PurchaseConnector class. (No grep -q: it closes the pipe early, and under pipefail + # nm's SIGPIPE would fail the check even when the symbol is present.) + if ! nm -u "$APP/Frameworks/UnityFramework.framework/UnityFramework" | grep '_OBJC_CLASS_\$_PurchaseConnector$' >/dev/null; then + echo "::error::UnityFramework does not reference the PurchaseConnector class - AppsFlyeriOSWrapper.mm was compiled with the no-op stubs" + exit 1 + fi + echo "PurchaseConnector.framework embedded and referenced by UnityFramework" + - name: Upload xcodebuild log if: always() uses: actions/upload-artifact@v4 diff --git a/scripts/af-scenario-runner.sh b/scripts/af-scenario-runner.sh index 37f71307..08c0aacd 100755 --- a/scripts/af-scenario-runner.sh +++ b/scripts/af-scenario-runner.sh @@ -391,8 +391,10 @@ ios_collect_logs() { if [[ -n "$IOS_LAST_PID" ]]; then predicate_args=(--predicate "processIdentifier == $IOS_LAST_PID") fi + # --info: the AppsFlyer SDK (including Purchase Connector) logs at os_log Info level, which + # `log show` drops by default; phase_9's native [PurchaseConnector] checks depend on it. xcrun simctl spawn "$IOS_UDID" log show \ - --last 240s --style compact ${predicate_args[@]+"${predicate_args[@]}"} 2>&1 | \ + --last 240s --info --style compact ${predicate_args[@]+"${predicate_args[@]}"} 2>&1 | \ grep -E "${LOG_TAG}|appsflyer|CFNetwork:Summary|response_status|response code|Opening URL|launchservices|openURL|continueUserActivity" >> "$log_file" || true # Best-effort screenshot for failure triage (no-op if nothing booted). diff --git a/test-app/Assets/Scripts/QATestScript.cs b/test-app/Assets/Scripts/QATestScript.cs index b548a97a..ef2aa555 100644 --- a/test-app/Assets/Scripts/QATestScript.cs +++ b/test-app/Assets/Scripts/QATestScript.cs @@ -299,16 +299,23 @@ void RunPreStartApis() AFQALogger.Log("[AF_QA][AUTO_APIS] --- Pre-start auto APIs complete ---"); } - // ── Purchase Connector (Android) ────────────────────────────────────────── - - // Must run before AppsFlyer.start(). Billing comes from Assets/Editor/TestAppDependencies.xml. - // E2E phase_8 checks the native "[PurchaseConnector]: Start Observing Transactions" log that - // this produces; if purchase-connector is missing from the APK the C# guard turns these calls - // into no-ops and logs "Purchase Connector is unavailable on Android" instead. + // ── Purchase Connector ──────────────────────────────────────────────────── + + // Must run before AppsFlyer.start(). + // Android: Billing comes from Assets/Editor/TestAppDependencies.xml. E2E phase_8 checks the + // native "[PurchaseConnector]: Start Observing Transactions" log; if purchase-connector is + // missing from the APK the C# guard turns these calls into no-ops and logs + // "Purchase Connector is unavailable on Android" instead. + // iOS: E2E phase_9 checks the native "[PurchaseConnector] AppsFlyerARS has been set to Sandbox + // environment" log. If PurchaseConnector isn't linked, AppsFlyeriOSWrapper.mm compiles silent + // stubs, so that log is the only sign the real framework ran. void SetupPurchaseConnector() { -#if UNITY_ANDROID && !UNITY_EDITOR +#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR AppsFlyerPurchaseConnector.init(this, Store.GOOGLE); +#if UNITY_IOS + AppsFlyerPurchaseConnector.setStoreKitVersion(StoreKitVersion.SK2); +#endif AppsFlyerPurchaseConnector.setIsSandbox(true); AppsFlyerPurchaseConnector.setAutoLogPurchaseRevenue( AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions, From bd8dc8f20dfb9e916bb98700da52f3bc830f1b7c Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Wed, 25 Nov 2026 16:07:54 +0200 Subject: [PATCH 5/9] bump changelog version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c9f8fe..f644118d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Versions -## Unreleased +## v7.0.42 * **Fix (DELIVERY-137580):** Android Purchase Connector is enabled again. `com.appsflyer:purchase-connector:2.3.0` had been commented out in `AppsFlyerDependencies.xml` because of a manifest-package collision with `af-android-sdk` (both `com.appsflyer`), so Purchase Connector calls on Android were no-ops. AGP 8.x From 07a4f9b42b2744d6abd21d2b6a817b6f1a16bf8d Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Wed, 25 Nov 2026 16:43:27 +0200 Subject: [PATCH 6/9] fix: address review feedback (DELIVERY-137580) - test-plan: drop absent patterns the runner's log filter can never see (Android NoClassDefFoundError, iOS "Library not loaded" / "unrecognized selector"). The positive native [PurchaseConnector] checks remain the guard; the Android guard warning check stays because it carries the [AppsFlyer] tag. - af-scenario-runner: add PurchaseConnector to the iOS log filter so the native lines don't depend on the lowercase subsystem prefix. - rc-e2e-ios: check the PurchaseConnector class symbol first (defined or undefined) and require the embedded framework only when it is linked dynamically; fix the regex to match nm -m's "(from PurchaseConnector)" suffix. - AppsFlyerGradlePropertiesProcessor: remove the UNITY_ANDROID guard so a scripted Android build started from another active platform still gets the hook. IPostGenerateGradleAndroidProject lives in UnityEditor.CoreModule, so it compiles without the Android module. - AppsFlyerPurchaseConnector: the unavailable warning also names a missing or older Play Billing Library 8 as a cause. - README, docs/purchase-connector.md, CHANGELOG: the app must provide Billing 8.x (e.g. Unity IAP 5.x); Billing 7 / Unity IAP 4.x is not supported. Verified: without Billing, both an R8 release build and a dev build build and run without crashing (guard warning logged, start SUCCESS, all requests HTTP 200); the iOS Unity export compiles the processor without UNITY_ANDROID; the iOS CI step passes on a real build and fails on a binary without the symbol. Co-Authored-By: Claude Opus 5.5 --- .af-e2e/test-plan.json | 11 ++------- .github/workflows/rc-e2e-ios.yml | 24 ++++++++++++------- .../AppsFlyer/AppsFlyerPurchaseConnector.cs | 8 ++++--- .../AppsFlyerGradlePropertiesProcessor.cs | 6 ++++- CHANGELOG.md | 3 +++ README.md | 1 + docs/purchase-connector.md | 2 +- scripts/af-scenario-runner.sh | 4 +++- 8 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.af-e2e/test-plan.json b/.af-e2e/test-plan.json index 36f867c7..b0c7c9b5 100644 --- a/.af-e2e/test-plan.json +++ b/.af-e2e/test-plan.json @@ -468,9 +468,9 @@ }, { "id": "pc_not_missing", - "description": "C# guard did not report a missing purchase-connector dependency", + "description": "C# guard did not fall back to no-ops (its warning carries the [AppsFlyer] tag, so it passes the runner's logcat filter; the native-log checks above are the primary guard)", "type": "absent", - "patterns": ["Purchase Connector is unavailable on Android", "NoClassDefFoundError"], + "patterns": ["Purchase Connector is unavailable on Android"], "fail_action": "fail" }, { @@ -512,13 +512,6 @@ "pattern": "[PurchaseConnector] Resolved cached PurchaseConnectorEvents", "fail_action": "fail" }, - { - "id": "pc_linked", - "description": "No missing framework or selector errors", - "type": "absent", - "patterns": ["Library not loaded", "unrecognized selector"], - "fail_action": "fail" - }, { "id": "no_fatal_errors", "description": "No fatal exceptions", diff --git a/.github/workflows/rc-e2e-ios.yml b/.github/workflows/rc-e2e-ios.yml index cad23d2d..25c9e783 100644 --- a/.github/workflows/rc-e2e-ios.yml +++ b/.github/workflows/rc-e2e-ios.yml @@ -277,19 +277,25 @@ jobs: - name: Verify Purchase Connector is linked into the .app run: | APP=test-app/Build/iOS-Simulator/UnityQATest.app - if [[ ! -d "$APP/Frameworks/PurchaseConnector.framework" ]]; then - echo "::error::PurchaseConnector.framework is not embedded in UnityQATest.app (PurchaseConnector pod/SPM package not resolved from AppsFlyerDependencies.xml)" + UF="$APP/Frameworks/UnityFramework.framework/UnityFramework" + # AppsFlyeriOSWrapper.mm compiles silent no-op stubs when PurchaseConnector-Swift.h is + # not found, so the real bridge is proven by UnityFramework referencing the @objc + # PurchaseConnector class (verified with nm on a real build: "(undefined) external + # _OBJC_CLASS_$_PurchaseConnector (from PurchaseConnector)"). Undefined = dynamically + # linked (SPM PurchaseConnector-Dynamic), so the framework must also be embedded; + # defined = statically linked into UnityFramework, nothing to embed. + # (No grep -q: it closes the pipe early and nm's SIGPIPE would fail under pipefail.) + SYMBOLS=$(nm -m "$UF" | grep -E '_OBJC_CLASS_\$_PurchaseConnector( |$)' || true) + echo "$SYMBOLS" + if [[ -z "$SYMBOLS" ]]; then + echo "::error::UnityFramework does not reference the PurchaseConnector class - AppsFlyeriOSWrapper.mm was compiled with the no-op stubs (PurchaseConnector pod/SPM package not resolved)" exit 1 fi - # AppsFlyeriOSWrapper.mm compiles silent no-op stubs when PurchaseConnector-Swift.h is - # not found, so the embedded framework alone is not enough: the real bridge references - # the PurchaseConnector class. (No grep -q: it closes the pipe early, and under pipefail - # nm's SIGPIPE would fail the check even when the symbol is present.) - if ! nm -u "$APP/Frameworks/UnityFramework.framework/UnityFramework" | grep '_OBJC_CLASS_\$_PurchaseConnector$' >/dev/null; then - echo "::error::UnityFramework does not reference the PurchaseConnector class - AppsFlyeriOSWrapper.mm was compiled with the no-op stubs" + if echo "$SYMBOLS" | grep '(undefined)' >/dev/null && [[ ! -d "$APP/Frameworks/PurchaseConnector.framework" ]]; then + echo "::error::UnityFramework links PurchaseConnector dynamically but PurchaseConnector.framework is not embedded in UnityQATest.app (dyld would fail at launch)" exit 1 fi - echo "PurchaseConnector.framework embedded and referenced by UnityFramework" + echo "PurchaseConnector bridge linked into UnityFramework" - name: Upload xcodebuild log if: always() diff --git a/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs b/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs index 2a70b064..486f1b36 100644 --- a/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs +++ b/Assets/AppsFlyer/AppsFlyerPurchaseConnector.cs @@ -293,9 +293,11 @@ private static void WarnConnectorUnavailable(Exception e) { if (_connectorUnavailableWarned) return; _connectorUnavailableWarned = true; - Debug.LogWarning("[AppsFlyer] Purchase Connector is unavailable on Android: " + - "com.appsflyer:purchase-connector is missing from the build. Make sure External " + - "Dependency Manager resolved Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml. " + + Debug.LogWarning("[AppsFlyer] Purchase Connector is unavailable on Android. Possible causes: " + + "(1) com.appsflyer:purchase-connector is missing from the build - make sure External " + + "Dependency Manager resolved Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml; " + + "(2) Google Play Billing Library 8 is missing or older - Purchase Connector requires the " + + "app to provide com.android.billingclient:billing 8.x (e.g. Unity IAP 5.x). " + "Purchase Connector calls will be no-ops. " + e); } #endif diff --git a/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs index 2696e10b..52ae9db8 100644 --- a/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs +++ b/Assets/AppsFlyer/Editor/AppsFlyerGradlePropertiesProcessor.cs @@ -1,4 +1,8 @@ -#if UNITY_ANDROID && !APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX +// Not guarded by UNITY_ANDROID: a scripted Android build started while the Editor's active platform +// is iOS/Standalone would otherwise compile without this hook. IPostGenerateGradleAndroidProject +// lives in UnityEditor.CoreModule, so this compiles without the Android module, and Unity only +// invokes it for Android builds. +#if !APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX using System.IO; using UnityEditor.Android; using UnityEngine; diff --git a/CHANGELOG.md b/CHANGELOG.md index f644118d..b9c623a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The plugin now adds `android.uniquePackageNames=false` to the generated `gradle.properties` at build time (new `AppsFlyerGradlePropertiesProcessor`), unless the project already sets the property. Define `APPSFLYER_DISABLE_UNIQUE_PACKAGE_NAMES_FIX` to opt out (see README). + Purchase Connector requires the app to provide Google Play Billing Library 8.x (e.g. Unity IAP 5.x); + Billing 7 / Unity IAP 4.x is not supported. Apps that don't call `AppsFlyerPurchaseConnector` are + unaffected. ## v7.0.41 * **Fix (DELIVERY-135217):** `AFMiniJSON` formatted and parsed numbers using the device's current diff --git a/README.md b/README.md index 729282b6..6dd8e675 100755 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ From **v6.18.0** onward, the Unity plugin ships as a **single release line** wit - **Unity IAP:** Use **Unity IAP (`com.unity.purchasing`) 5.0.0 or newer** (recommended: latest 5.x). Unity IAP 4.x does **not** include Billing v8. - **Migration:** Apps still on Billing v7 must migrate to Billing v8 APIs before upgrading to 6.18.0+. +- **The app provides Billing:** `com.appsflyer:purchase-connector` does not pull in Google Play Billing itself (it is a compile-only dependency). If you call `AppsFlyerPurchaseConnector` on Android, your app must include `com.android.billingclient:billing` 8.x, normally through Unity IAP 5.x. Without it (or with Unity IAP 4.x / Billing 7) Purchase Connector does not work and logs a warning. Apps that never call `AppsFlyerPurchaseConnector` are not affected. ### Still on Billing Library v7? diff --git a/docs/purchase-connector.md b/docs/purchase-connector.md index f973aa17..08cbaf0a 100644 --- a/docs/purchase-connector.md +++ b/docs/purchase-connector.md @@ -24,7 +24,7 @@ The AppsFlyer ROI360 purchase connector is used to validate and report in-app pu - Unity AppsFlyer plugin **6.17.1** and higher ### Android Requirements -- Google Play Billing library version **7.x.x** and **8.x.x** +- Google Play Billing library version **8.x.x**, provided by the app (e.g. Unity IAP 5.x). Billing 7 is supported only by the 6.17.x dual-line releases (see below) - Unity AppsFlyer plugin **6.17.1** and higher ### General Requirements diff --git a/scripts/af-scenario-runner.sh b/scripts/af-scenario-runner.sh index 08c0aacd..1ba2131a 100755 --- a/scripts/af-scenario-runner.sh +++ b/scripts/af-scenario-runner.sh @@ -393,9 +393,11 @@ ios_collect_logs() { fi # --info: the AppsFlyer SDK (including Purchase Connector) logs at os_log Info level, which # `log show` drops by default; phase_9's native [PurchaseConnector] checks depend on it. + # PurchaseConnector is in the grep filter so those lines don't rely on the lowercase + # "com.appsflyer" subsystem prefix that --style compact happens to print today. xcrun simctl spawn "$IOS_UDID" log show \ --last 240s --info --style compact ${predicate_args[@]+"${predicate_args[@]}"} 2>&1 | \ - grep -E "${LOG_TAG}|appsflyer|CFNetwork:Summary|response_status|response code|Opening URL|launchservices|openURL|continueUserActivity" >> "$log_file" || true + grep -E "${LOG_TAG}|appsflyer|PurchaseConnector|CFNetwork:Summary|response_status|response code|Opening URL|launchservices|openURL|continueUserActivity" >> "$log_file" || true # Best-effort screenshot for failure triage (no-op if nothing booted). local shot_dir="${log_file%/*}" From c68e9fd06d72b017913a8aba3bedb2f542821aca Mon Sep 17 00:00:00 2001 From: af-margot Date: Wed, 25 Nov 2026 15:46:32 +0000 Subject: [PATCH 7/9] chore: bump to 7.0.42-rc1 --- Assets/AppsFlyer/AppsFlyer.cs | 2 +- Assets/AppsFlyer/package.json | 2 +- CHANGELOG.md | 6 ++++++ deploy/build_unity_package.sh | 2 +- deploy/strict_mode_build_package.sh | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Assets/AppsFlyer/AppsFlyer.cs b/Assets/AppsFlyer/AppsFlyer.cs index 756396dd..3eacbe9a 100644 --- a/Assets/AppsFlyer/AppsFlyer.cs +++ b/Assets/AppsFlyer/AppsFlyer.cs @@ -17,7 +17,7 @@ namespace AppsFlyerSDK #pragma warning disable CS1998 public class AppsFlyer : MonoBehaviour { - public static readonly string kAppsFlyerPluginVersion = "7.0.41"; + public static readonly string kAppsFlyerPluginVersion = "7.0.42-rc1"; public static string CallBackObjectName = null; private static EventHandler onSessionReady; private static Action onConversionDataSuccessCallback; diff --git a/Assets/AppsFlyer/package.json b/Assets/AppsFlyer/package.json index 1de1c036..8b1e6f2f 100644 --- a/Assets/AppsFlyer/package.json +++ b/Assets/AppsFlyer/package.json @@ -2,7 +2,7 @@ "name": "appsflyer-unity-plugin", "displayName": "AppsFlyer", "description": "AppsFlyer Unity plugin", - "version": "7.0.41", + "version": "7.0.42-rc1", "unity": "2023.1", "license": "MIT" } diff --git a/CHANGELOG.md b/CHANGELOG.md index e27ba165..57a959ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ Billing 7 / Unity IAP 4.x is not supported. Apps that don't call `AppsFlyerPurchaseConnector` are unaffected. +* Update af-android-plugin-bridge version - 7.0.13 +* Update AppsFlyerRPC version - 7.0.41 +* Update Android unity-wrapper version - 7.0.16 +* Update iOS Purchase Connector version - 7.0.4 +* Update Android Purchase Connector version - 2.3.0 +* Unity plugin version - 7.0.42-rc1 ## v7.0.41 * **Fix (DELIVERY-135217):** `AFMiniJSON` formatted and parsed numbers using the device's current culture. On comma-decimal locales (e.g. `vi-VN`, `de-DE`, `fr-FR`, `ru-RU`) RPC requests carried diff --git a/deploy/build_unity_package.sh b/deploy/build_unity_package.sh index d958776c..56d8ac28 100755 --- a/deploy/build_unity_package.sh +++ b/deploy/build_unity_package.sh @@ -6,7 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" DEPLOY_PATH="$SCRIPT_DIR/outputs" -PACKAGE_NAME="appsflyer-unity-plugin-7.0.41.unitypackage" +PACKAGE_NAME="appsflyer-unity-plugin-7.0.42-rc1.unitypackage" UNITY_BIN="${UNITY_PATH:-/Applications/Unity/Unity.app/Contents/MacOS/Unity}" EDM_PACKAGE="$REPO_ROOT/Assets/ExternalDependencyManager/Editor/external-dependency-manager-1.2.187.unitypackage" OUTPUT_DIR="$DEPLOY_PATH" diff --git a/deploy/strict_mode_build_package.sh b/deploy/strict_mode_build_package.sh index 167d45be..c16e9132 100755 --- a/deploy/strict_mode_build_package.sh +++ b/deploy/strict_mode_build_package.sh @@ -6,7 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" DEPLOY_PATH="$SCRIPT_DIR/outputs" -PACKAGE_NAME="appsflyer-unity-plugin-strict-mode-7.0.41.unitypackage" +PACKAGE_NAME="appsflyer-unity-plugin-strict-mode-7.0.42-rc1.unitypackage" UNITY_BIN="${UNITY_PATH:-/Applications/Unity/Unity.app/Contents/MacOS/Unity}" EDM_PACKAGE="$REPO_ROOT/Assets/ExternalDependencyManager/Editor/external-dependency-manager-1.2.187.unitypackage" OUTPUT_DIR="$DEPLOY_PATH" From 8319afbcbd2bb0207fff5ce9eb63b066fc73c792 Mon Sep 17 00:00:00 2001 From: Ivan Obodovskyi Date: Wed, 25 Nov 2026 19:23:43 +0200 Subject: [PATCH 8/9] fix android stuck issue --- scripts/af-scenario-runner.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/af-scenario-runner.sh b/scripts/af-scenario-runner.sh index 1ba2131a..ebeb5d0f 100755 --- a/scripts/af-scenario-runner.sh +++ b/scripts/af-scenario-runner.sh @@ -211,7 +211,10 @@ android_launch() { # which holds only ~10-20s at typical Unity rates. adb logcat -G 32m 2>/dev/null || true adb logcat -c - adb shell am start -n "${PACKAGE_NAME}/${ACTIVITY}" 2>/dev/null || \ + # -force-gles: Development builds crash on the emulator's Vulkan (Unity SIGSEGV in + # vk::DebugToolsUtils::SetVkDebugObjectName, host gfxstream on Apple Silicon). Unity reads + # the "unity" intent extra as command-line args; GLES3 avoids the Vulkan debug-label path. + adb shell am start -n "${PACKAGE_NAME}/${ACTIVITY}" -e unity "-force-gles" 2>/dev/null || \ adb shell monkey -p "$PACKAGE_NAME" -c android.intent.category.LAUNCHER 1 2>/dev/null } @@ -272,7 +275,7 @@ android_background_app() { android_trigger_deeplink() { local url="$1" log_info "Triggering deep link: $url" - adb shell am start -W -a android.intent.action.VIEW -d "$url" + adb shell am start -W -a android.intent.action.VIEW -d "$url" -e unity "-force-gles" } android_is_alive() { From 0a872a64777ffec6751db4e8ea156e1ea05d0d29 Mon Sep 17 00:00:00 2001 From: af-margot Date: Wed, 25 Nov 2026 18:10:50 +0000 Subject: [PATCH 9/9] chore: promote to 7.0.42 --- Assets/AppsFlyer/AppsFlyer.cs | 2 +- Assets/AppsFlyer/package.json | 2 +- CHANGELOG.md | 2 +- deploy/build_unity_package.sh | 2 +- deploy/strict_mode_build_package.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/AppsFlyer/AppsFlyer.cs b/Assets/AppsFlyer/AppsFlyer.cs index 3eacbe9a..6760d4f1 100644 --- a/Assets/AppsFlyer/AppsFlyer.cs +++ b/Assets/AppsFlyer/AppsFlyer.cs @@ -17,7 +17,7 @@ namespace AppsFlyerSDK #pragma warning disable CS1998 public class AppsFlyer : MonoBehaviour { - public static readonly string kAppsFlyerPluginVersion = "7.0.42-rc1"; + public static readonly string kAppsFlyerPluginVersion = "7.0.42"; public static string CallBackObjectName = null; private static EventHandler onSessionReady; private static Action onConversionDataSuccessCallback; diff --git a/Assets/AppsFlyer/package.json b/Assets/AppsFlyer/package.json index 8b1e6f2f..31a0f313 100644 --- a/Assets/AppsFlyer/package.json +++ b/Assets/AppsFlyer/package.json @@ -2,7 +2,7 @@ "name": "appsflyer-unity-plugin", "displayName": "AppsFlyer", "description": "AppsFlyer Unity plugin", - "version": "7.0.42-rc1", + "version": "7.0.42", "unity": "2023.1", "license": "MIT" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a959ba..bdb48460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ * Update Android unity-wrapper version - 7.0.16 * Update iOS Purchase Connector version - 7.0.4 * Update Android Purchase Connector version - 2.3.0 -* Unity plugin version - 7.0.42-rc1 +* Unity plugin version - 7.0.42 ## v7.0.41 * **Fix (DELIVERY-135217):** `AFMiniJSON` formatted and parsed numbers using the device's current culture. On comma-decimal locales (e.g. `vi-VN`, `de-DE`, `fr-FR`, `ru-RU`) RPC requests carried diff --git a/deploy/build_unity_package.sh b/deploy/build_unity_package.sh index 56d8ac28..e03b5452 100755 --- a/deploy/build_unity_package.sh +++ b/deploy/build_unity_package.sh @@ -6,7 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" DEPLOY_PATH="$SCRIPT_DIR/outputs" -PACKAGE_NAME="appsflyer-unity-plugin-7.0.42-rc1.unitypackage" +PACKAGE_NAME="appsflyer-unity-plugin-7.0.42.unitypackage" UNITY_BIN="${UNITY_PATH:-/Applications/Unity/Unity.app/Contents/MacOS/Unity}" EDM_PACKAGE="$REPO_ROOT/Assets/ExternalDependencyManager/Editor/external-dependency-manager-1.2.187.unitypackage" OUTPUT_DIR="$DEPLOY_PATH" diff --git a/deploy/strict_mode_build_package.sh b/deploy/strict_mode_build_package.sh index c16e9132..ee9d4fe4 100755 --- a/deploy/strict_mode_build_package.sh +++ b/deploy/strict_mode_build_package.sh @@ -6,7 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" DEPLOY_PATH="$SCRIPT_DIR/outputs" -PACKAGE_NAME="appsflyer-unity-plugin-strict-mode-7.0.42-rc1.unitypackage" +PACKAGE_NAME="appsflyer-unity-plugin-strict-mode-7.0.42.unitypackage" UNITY_BIN="${UNITY_PATH:-/Applications/Unity/Unity.app/Contents/MacOS/Unity}" EDM_PACKAGE="$REPO_ROOT/Assets/ExternalDependencyManager/Editor/external-dependency-manager-1.2.187.unitypackage" OUTPUT_DIR="$DEPLOY_PATH"