Skip to content

Update to 4.1 as an iOS-integration snapshot - #30

Draft
yauch-dev wants to merge 3 commits into
feature/newtonsoft-migrationfrom
feature/sdk-4.1-update
Draft

Update to 4.1 as an iOS-integration snapshot#30
yauch-dev wants to merge 3 commits into
feature/newtonsoft-migrationfrom
feature/sdk-4.1-update

Conversation

@yauch-dev

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

Copy link
Copy Markdown
Collaborator

Important

Draft on purpose: waiting for the Android SDK 4.1 release. The iOS half is done and accepted; this PR merges once the Android natives expose the matching 4.1 contract and get pinned here (crossplatform + android-sdk + the rebuilt unity-wrapper AAR). Until then the package version stays 4.1.0-dev.1 and must not be published.

What

Moves the SDK to cross-platform contract 4.1.0 and native AdaptySDK-iOS 4.1.0, as an iOS-integration snapshot: the Android SDK has no 4.1 release yet, so Android stays on the 4.0.x natives (crossplatform 4.0.2 / android-sdk 4.0.1), mirroring the Flutter plugin's cut. The version is 4.1.0-dev.1 and the changelog marks it not-for-publishing until the coordinated release.

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.
  • Native iOS 4.1 reads fallback file format 11 and rejects format 10 at SetFallback (adapty_code: 2006); the demo stub is updated and the migration guide tells users to re-download theirs.

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.
  • 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).

Deliberately not in this PR

  • Android 4.1 (does not exist); obfuscated_profile_id and error 1030 re-checked per AGENTS — status quo holds.
  • 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 (249 editor + 179 × iOS/Android/iOS+KidsMode); public surface byte-identical across platforms; contract copy byte-identical to the canonical file at tag 4.1.0.
  • 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.
  • 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.

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.
@yauch-dev
yauch-dev marked this pull request as draft August 15, 2026 19:33
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.
@yauch-dev yauch-dev added the enhancement New feature or request label Aug 15, 2026
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.

2 participants