Skip to content

Upgrade to AppsFlyer SDK v6.17.3 and add validateAndLogInAppPurchaseV2 API (Beta)#411

Merged
Dani-Koza-AF merged 37 commits intomasterfrom
development
Aug 24, 2025
Merged

Upgrade to AppsFlyer SDK v6.17.3 and add validateAndLogInAppPurchaseV2 API (Beta)#411
Dani-Koza-AF merged 37 commits intomasterfrom
development

Conversation

@Dani-Koza-AF
Copy link
Copy Markdown
Collaborator

SDK Version Upgrade

  • Bump AppsFlyer SDK to v6.17.3 for both Android and iOS
  • Update all version constants and dependencies across codebase
  • Update README.md and CHANGELOG.md with new version info

New validateAndLogInAppPurchaseV2 API (Beta)

  • Add unified cross-platform purchase validation API
  • Create AFPurchaseDetails data class with AFPurchaseType enum
  • Implement type-safe purchase validation with structured error handling
  • Support both one-time purchases and subscriptions

Platform Implementations

  • Android: Integrate real AppsFlyer SDK V2 API with AFPurchaseDetails and callbacks
  • iOS: Implement V2 validation adapted for iOS SDK capabilities
  • Flutter: Clean, minimal Dart interface with proper type definitions

Example App Integration

  • Add V2 purchase validation to demo app
  • Create UI for testing different purchase types
  • Add comprehensive error handling and result display

Documentation Updates

  • Add complete API documentation with beta warnings
  • Update API.md with new validateAndLogInAppPurchaseV2 section
  • Update AdvancedAPI.md with cross-platform V2 API guidance
  • Add StoreKit 2 configuration documentation to PurchaseConnector.md
  • Include comprehensive examples and migration guidance

🔧 Technical Details

Files Modified

  • pubspec.yaml, ios/appsflyer_sdk.podspec, android/build.gradle - version bumps
  • lib/src/af_purchase_details.dart - new purchase data structure
  • lib/src/appsflyer_sdk.dart - new V2 validation method
  • android/src/main/java/.../AppsflyerSdkPlugin.java - Android V2 implementation
  • ios/Classes/AppsflyerSdkPlugin.m - iOS V2 implementation
  • example/lib/ - demo app integration
  • doc/ - comprehensive documentation updates

Key Features

  • ✅ Cross-platform API consistency
  • ✅ Type-safe purchase validation
  • ✅ Real AppsFlyer SDK V2 endpoints
  • ✅ Backward compatibility maintained
  • ✅ Beta warnings and proper documentation
  • ✅ StoreKit 1/2 configuration support
  • ✅ Enhanced error handling

Breaking Changes

  • None - fully backward compatible

pazlavi and others added 30 commits June 13, 2024 16:24
- added a usage example of the api for testing.
…n-network-value-fix

Fixed the issue with MediationNetwork enums on Android
…null-pointer-exception

This should fix the NullPointerException
* bumped up PC versions

* set back ios version
commit fa71c23
Merge: f420460 4f4ee27
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Thu Oct 31 15:16:50 2024 +0200

    Merge remote-tracking branch 'origin/development' into development

commit f420460
Author: Dani Koza <103039399+Dani-Koza-AF@users.noreply.github.com>
Date:   Wed Oct 30 15:50:41 2024 +0200

    Releases/6.x.x/6.15.x/6.15.2 rc1 (#358)

    * fixed the issue with MediationNetwork enums on Android

    * Added a usage example of the logAdRevenue api for testing.

    * Fix to the NullPointerException some clients face.

    * Versioning and change log

commit 4f4ee27
Merge: a58a49b 25fb530
Author: Dani Koza <103039399+Dani-Koza-AF@users.noreply.github.com>
Date:   Wed Oct 30 14:47:17 2024 +0200

    Merge pull request #357 from AppsFlyerSDK/DELIVERY-63011/fix-android-null-pointer-exception

    This should fix the NullPointerException

commit 25fb530
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Wed Oct 30 14:26:26 2024 +0200

    This should fix the NullPointerException

commit a58a49b
Merge: 6213341 b85b1a4
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Mon Oct 28 12:30:10 2024 +0200

    Merge remote-tracking branch 'origin/development' into development

commit b85b1a4
Merge: 82764a4 6529458
Author: Dani Koza <103039399+Dani-Koza-AF@users.noreply.github.com>
Date:   Mon Oct 28 12:15:32 2024 +0200

    Merge pull request #353 from AppsFlyerSDK/dev/DELIVERY-71973/mediation-network-value-fix

    Fixed the issue with MediationNetwork enums on Android

commit 6529458
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Sun Oct 27 17:47:00 2024 +0200

    fixed the issue with MediationNetwork enums on Android

    - added a usage example of the api for testing.

commit 6213341
Merge: 3272d7e 82764a4
Author: Dani-Koza-AF <103039399+Dani-Koza-AF@users.noreply.github.com>
Date:   Wed Sep 4 15:51:28 2024 +0300

    Merge pull request #338 from AppsFlyerSDK/releases/6.x.x/6.15.x/6.15.1-rc1

    Releases/6.x.x/6.15.x/6.15.1 rc1

commit 82764a4
Merge: 3272d7e 6b76d63
Author: Dani-Koza-AF <103039399+Dani-Koza-AF@users.noreply.github.com>
Date:   Wed Sep 4 15:15:03 2024 +0300

    Merge pull request #337 from AppsFlyerSDK/dev/DELIVERY-67805/Update-Plugin-to-v6.15.1

    Update plugin to v6.15.1

commit 6b76d63
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Wed Sep 4 15:13:04 2024 +0300

    Added missing info in docs

commit e7d4dc6
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Wed Sep 4 14:17:28 2024 +0300

    Added documentation

commit 9f90c8e
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Tue Sep 3 17:48:33 2024 +0300

    Improvement of Android side impl

commit 079ccad
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Tue Sep 3 17:22:48 2024 +0300

    iOS side impl

    - Helper func to get the correct enum properly.
    - requireNonNullArgumentWithCall to make sure we actually get the arguments.
    - Lots of null safety checks due to testing failures encountered.

commit 4a3a0d6
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Mon Sep 2 14:48:30 2024 +0300

    Android side impl

    - Flutter didn't like the fact that we pass enums, had to change mediation network to String, handled later on native side.
    - Added an helper method to ensure null safety,  hopefully will be embraced by other method in the future.

commit d74054e
Author: Dani-Koza-AF <dani.ko@appsflyer.com>
Date:   Sun Sep 1 16:43:24 2024 +0300

    flutter side impl

    - New Enum introduced.
    - New API logAdRevenue.
    - New AdRevenueData class.
    - Upgraded Dart SDK versions limits a bit to start from 2.17.0 .

commit 3272d7e
Merge: 95a4348 248dcf5
Author: liaz-af <61788924+liaz-af@users.noreply.github.com>
Date:   Mon Aug 19 22:35:24 2024 +0300

    Merge pull request #336 from dori-af/dori/udl-note

    Deep link UDL - added a note

commit 248dcf5
Author: Dori Frost <dori.frost@appsflyer.com>
Date:   Sun Aug 18 16:35:07 2024 +0300

    Deep link UDL - added a note

    Per Slack: https://appsflyer.slack.com/archives/C5RDRS58X/p1723186908673099
Aligned Flutter's Android compileOptions to AppsFlyer's Android SDK.
* updated BasicIntegration.md

* docs: updated push notification API's
New consent api and more
- setConsentData is now deprecated.
- setConsentDataV2 is the new and recommended way to set manual user consent.
- Add getVersionNumber api, returns the plugin version.
- version bumps.
- typos fix.
- doc updates.
- bug fix.
Dani-Koza-AF and others added 7 commits June 26, 2025 13:15
- Expanded the unit–tests to verify not only that the right native method is invoked, but also that the correct arguments are passed.
doc fix - broken link
* removed duplicated declaration

* Update .gitignore for purchase connector feature

* Add complete Purchase Connector implementation

- Add Purchase Connector support for Android and iOS platforms
- Implement conditional compilation with include/exclude source sets
- Add comprehensive Dart API with type-safe models
- Include platform-specific error handling and validation
- Add Purchase Connector documentation
- Support for both in-app purchases and subscriptions
- Zero impact when disabled via gradle/podfile flags

New files:
- Complete lib/src/purchase_connector/ Dart implementation
- Android: include/exclude-connector source sets with ConnectorWrapper
- iOS: PurchaseConnectorPlugin.swift with conditional compilation
- Documentation: PurchaseConnector.md

Modified integration points:
- Android: build.gradle, AppsflyerSdkPlugin.java
- iOS: appsflyer_sdk.podspec with subspecs architecture
- Flutter: appsflyer_sdk.dart main export file

* Complete Purchase Connector integration with code generation

- Add missing Purchase Connector constants and AFMediationNetwork enum
- Update pubspec.yaml with required dependencies (json_annotation, build_runner, json_serializable)
- Generate JSON serialization code for all Purchase Connector models
- Fix all compilation errors and undefined references
- All 39 tests passing ✅
- Purchase Connector fully functional with type-safe models

Generated files:
- lib/appsflyer_sdk.g.dart - JSON serialization support
- All Purchase Connector model serialization methods

Dependencies added:
- json_annotation: ^4.9.0 (already present)
- build_runner: ^2.3.0
- json_serializable: ^6.5.4

* setting the proper SDK versions

* documentation small fix

* restore and solve code conflicts and ghost code

Aligned with development
1. Fixed startSDKwithHandler() method: Null checks moved inside lambda execution
2. Fixed runOnUIThread() method: Added null check for mCallbackChannel.
3. Immediately return initSdk method when dev key is missing.
* add disableAppSetId() method for AppSet ID opt-out

* added a simple test for the new api

* docs

* another doc update

* documents fix lint

* doc lint

* doc

* doc fix

* last time doc fix

* docs
* iOS >> Added support for Setting StoreKit2 properly

* versions bump

* Dart + Android implementation

* iOS implementation

* docs update

* purchase connector doc update for StoreKitV2 support
@Dani-Koza-AF Dani-Koza-AF requested a review from al-af August 24, 2025 13:44
@Dani-Koza-AF Dani-Koza-AF merged commit 5446559 into master Aug 24, 2025
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.

3 participants