Skip to content

Adapty SDK 4.1.0: contract 4.1 and the 4.1 natives on both platforms - #30

Merged
x401om merged 5 commits into
devfrom
feature/sdk-4.1-update
Aug 20, 2026
Merged

Adapty SDK 4.1.0: contract 4.1 and the 4.1 natives on both platforms#30
x401om merged 5 commits into
devfrom
feature/sdk-4.1-update

Conversation

@yauch-dev

@yauch-dev yauch-dev commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Moves the SDK to cross-platform contract 4.1.0 and the 4.1.0 natives on both platforms:
AdaptySDK-iOS 4.1.0 and, since the Android 4.1.0 release landed, crossplatform 4.1.0 /
android-sdk 4.1.0 / android-ui 4.1.0 with the bundled unity-wrapper AAR rebuilt at 4.1.0. The
version is 4.1.0 — the iOS-only snapshot this PR started as, and the not-for-publishing gate it
carried, are gone with the condition that raised them.

Breaking

  • UpdateAttributionUpdateExternalAttribution (sourceprovider),
    AdaptyProfile.AppliedAttributionSourcesAppliedExternalAttributionProviders — matching the
    native 4.1 rename, no deprecated aliases. Wire key of the profile member unchanged.
  • IAdaptyEventListener gained OnReceivePromotedPurchase(AdaptyPromotedProduct) — a deliberate
    abstract add, no default implementation: the iOS default is silently purchase, which should not
    hide in a default.
  • Adapty Attribution is opt-in, and installation details come with it. The 4.1 natives collect
    installation details only when the configuration asks; the 4.0 natives collected them
    unconditionally. So OnInstallationDetailsSuccess stops firing and
    GetCurrentInstallationStatus stops reporting Determined until the app sets
    SetAdaptyAttributionEnabled(true) — on both platforms. It has its own migration step.
  • The 4.1 natives read fallback file format 11 and reject format 10 at SetFallback, on both
    platforms: DecodingFailed (adapty_code: 2006) on iOS, WrongParam (adapty_code: 3001) on
    Android. Both demo stubs are format 11 and the guide tells users to re-download both files.

Added

  • Adapty.MakePromotedPurchase + AdaptyPromotedProduct (App Store promoted purchases, iOS only).
    Note: the pinned native completes promoted purchases itself and does not emit the event yet
    (AdaptyPluginDelegate keeps the default implementation behind a TODO at tag 4.1.0); the listener
    method starts firing only once a future SDK release moves the exact pin to a native that reports
    them.
  • AdaptyConfiguration.Builder.AdaptyAttributionEnabled (+SetAdaptyAttributionEnabled), off and
    unsent by default — see the breaking entry above for what that now costs.
  • A product request writes its offer identifier nested as subscription.offer.offer_identifier
    through AdaptySubscriptionOfferRequest, shared by the paywall and promoted DTOs; the flat key is
    no longer written (natives read both, the contract documents only the nested form).
  • AdaptyFlow carries ui_schema (UIBuilder 5.1 custom layouts) to the renderer as an opaque
    private JObject — round-trip only, not public API.
  • MIGRATION-v4.0-to-v4.1.md, README pins and the changelog section (both copies, entry-set in
    sync).

Re-checked against the 4.1.0 natives, no change needed

  • The error code set is the same on both platforms: iOS AdaptyError.swift is byte-identical
    between 4.0.2 and 4.1.0, and Android only added a @Deprecated annotation to 1004. The one
    behavioural change is that Android 4.1 no longer surfaces NoPurchasesToRestore
    RestorePurchases completes with the current profile — and iOS never sent it, so the member is
    documented as unreachable at these pins instead of as Android-only.
  • obfuscated_profile_id is still declared in the contract and implemented by nobody, iOS included,
    which is what AGENTS asks to confirm on every native bump.
  • preloadFlows / preloadOnboardings and the customLayoutId argument that Android 4.1 added are
    not in the cross-platform contract, so there is nothing for this SDK to expose.
  • Android reads the offer of a purchase request out of the base64 payload_data blob and drops the
    readable offer node, so writing the offer identifier nested only is safe there.

Deliberately not in this PR

  • The iOS pin stays at 4.1.0. release/4.1.1 exists upstream (one commit — the visionOS build
    restore — and the version bump) but is not tagged or released, and an exact SwiftPM pin needs the
    tag. Moving to 4.1.1 is a follow-up once iOS ships it; it changes no API this SDK touches.
  • The contract's offer-identifier union not listing type: "code" while both iOS and this SDK
    handle it — pre-existing, a question for the contract owners.

Testing

  • JSON layer: full four-leg matrix green in CI (editor + iOS + Android + iOS/KidsMode).
  • Contract conformance pass run against 4.1.0 (extractor mapping updated); it caught the missing
    #if UNITY_IOS gate on the promoted product's is_family_shareable, now aligned with the paywall
    product. The final commit changes no wire format, so the pass was not re-run for it.
  • Simulator acceptance on iPhone 17 Pro against live backend with a StoreKit configuration:
    activation (fallback format 11 accepted), GetFlow calm10 + products, a purchase through the new
    nested offer envelope (intro offer applied, [Environment: Xcode]), profile update arriving via
    did_load_latest_profile (Premium: true), UpdateExternalAttribution, and full-screen flow
    rendering by native UIBuilder 5.1.
  • Android device acceptance is still owed — the 4.1.0 natives here have not been run on a
    device. It is on the release-branch checklist: activation with the format 11 stub, GetFlow +
    products, a purchase, UpdateExternalAttribution, and installation details behind the new flag.

@yauch-dev
yauch-dev marked this pull request as draft August 15, 2026 19:33
@yauch-dev yauch-dev added the enhancement New feature or request label Aug 15, 2026
@x401om x401om changed the title Update to 4.1 as an iOS-integration snapshot Adapty SDK 4.1.0: contract 4.1 and the 4.1 natives on both platforms Aug 20, 2026
@x401om
x401om marked this pull request as ready for review August 20, 2026 14:18
Base automatically changed from feature/newtonsoft-migration to dev August 20, 2026 14:27
yauch-dev and others added 5 commits August 20, 2026 15:27
Contract 4.1.0 and native AdaptySDK-iOS 4.1.0. Android stays on the
4.0.x natives until its 4.1 release, mirroring the Flutter plugin's
cut, so this version is marked not-for-publishing in the changelog.

- UpdateAttribution -> UpdateExternalAttribution with source ->
  provider, and AppliedAttributionSources ->
  AppliedExternalAttributionProviders, matching the native rename; no
  deprecated aliases, and the profile member's wire key stays
- AdaptyConfiguration.Builder.AdaptyAttributionEnabled, off and unsent
  by default
- MakePromotedPurchase, AdaptyPromotedProduct and
  IAdaptyEventListener.OnReceivePromotedPurchase for App Store promoted
  purchases; the pinned native completes them itself and does not emit
  the event yet, so the API is wired for the release that does
- a product request writes its offer identifier nested as
  subscription.offer.offer_identifier, through an envelope DTO shared
  by the paywall and promoted product requests; the flat key is gone
- AdaptyFlow carries ui_schema to the renderer as an opaque JObject,
  pinned by the flow-full round trip
- the demo's iOS fallback stub moves to format 11, which native 4.1
  requires; verified on a simulator together with a StoreKit-config
  purchase, the profile update event, and flow rendering
- 4.1.0-dev.1 in the version fields, changelog with the migration
  link, README pins, and MIGRATION-v4.0-to-v4.1.md
Symptoms before causes (the fallback section now opens with the error
the user actually sees), reassurance where the reader would worry (an
Android build does not break, an empty handler is a valid choice), and
the reasoning behind the missing deprecated aliases instead of the
bare fact.
The native dependency is pinned exactVersion 4.1.0, so a future native
release that starts forwarding didReceivePromotedPurchase cannot slip
into a build on its own — the handler fires only once an SDK release
moves the pin. The migration guide claimed otherwise; the changelog
copies said it vaguely enough to mislead. Review finding P2.
The Android 4.1.0 release landed and the previous commit pinned it — crossplatform, android-sdk,
android-ui and the rebuilt wrapper AAR — but it moved only the build files, so everything that
described the pin still described the iOS-only snapshot it used to be. This finishes the bump.

- The version is 4.1.0, not 4.1.0-dev.1, and the not-for-publishing gate is gone with the
  condition that raised it. package.json, the runtime constant and the pinned doc links move
  together; PackageManifestTests holds the first two to each other.
- The Android fallback stub in StreamingAssets was still format 10, which the 4.1 native rejects:
  the demo would have failed activation on Android at SetFallback. Both stubs are format 11 now,
  and the changelog and migration guide ask for both files rather than the iOS one.
- Adapty Attribution turning opt-in is a breaking change for anyone reading installation details,
  on both platforms: 4.0 collected them unconditionally, 4.1 collects nothing until the
  configuration asks. It was documented as "ignoring it changes nothing", which was true only
  while Android stayed on 4.0.x. It now has its own migration step.
- Android 4.1 stopped surfacing NoPurchasesToRestore — RestorePurchases completes with the profile
  instead — and iOS never sent it, so the member documents itself as unreachable at these pins
  rather than as Android-only behaviour.
- Re-checked against the 4.1.0 natives, no change needed: the error code set is the same on both
  platforms (iOS AdaptyError.swift is byte-identical to 4.0.2, Android only annotated 1004), and
  obfuscated_profile_id is still implemented by nobody, as AGENTS asks on every native bump.

4.0.0-beta.2 is never published: its changes ship as part of 4.1.0, and its changelog section says
so and points at the 4.1.0 tag.
@x401om
x401om force-pushed the feature/sdk-4.1-update branch from d6cbc16 to 5a73d15 Compare August 20, 2026 14:27
@x401om
x401om merged commit 773f8c9 into dev Aug 20, 2026
8 checks passed
@x401om
x401om deleted the feature/sdk-4.1-update branch August 20, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants