Skip to content

Align external attribution APIs with iOS SDK 4.1 - #198

Open
kupriyanovNik wants to merge 4 commits into
devfrom
feat/external-attribution-api-alignment
Open

Align external attribution APIs with iOS SDK 4.1#198
kupriyanovNik wants to merge 4 commits into
devfrom
feat/external-attribution-api-alignment

Conversation

@kupriyanovNik

Copy link
Copy Markdown

No description provided.

@kupriyanovNik

Copy link
Copy Markdown
Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10465c7d1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/src/constants/method.dart
@x401om

x401om commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review: contract alignment verified, four things to address

Checked the wire contract against AdaptySDK-iOS dev (with release/4.1.0 merged in) — it matches on every point:

Dart iOS 4.1
update_external_attribution_data, keys attribution / provider Request.UpdateExternalAttributionData.swift:13
adapty_attribution_enabled AdaptyConfiguration.Builder+Decodable.swift:19
profile wire key stays applied_attribution_sources AdaptyProfile.swift:105
six provider raw values, .trim() in the constructor AdaptyExternalAttributionProvider.swift:19-27 (trims as well)

I also diffed every Dart request-method constant against the iOS plugin's request methods — no drift beyond the native→Dart callbacks, which have no plugin counterpart by design. The rename looks complete; no references to the old names are left on the branch.

1. The value type lost const. AdaptyAttributionSource had a const constructor and static const appleAds; the new type uses static final because the constructor calls .trim() (lib/src/models/adapty_external_attribution_provider.dart:16). For consumers that is a regression: the constants can no longer be used in switch / case patterns (Dart 3 requires a constant expression), as default parameter values, or inside const collections. It also trips prefer_const_constructors_in_immutables for anyone using flutter_lints — this repo doesn't enable lints, which is why CI is green. A private const constructor keeps both the iOS trimming parity and const:

const AdaptyExternalAttributionProvider._(this.rawValue);
AdaptyExternalAttributionProvider(String rawValue) : rawValue = rawValue.trim();

static const appleAds = AdaptyExternalAttributionProvider._('apple_search_ads');
// ...

Equality between const and runtime instances still works through the == override.

2. The new tests never run. This PR adds test/external_attribution_api_test.dart — the first test in the repo — but the analyze-test job in .github/workflows/ci.yml only runs flutter pub get and flutter analyze. The green check says nothing about these tests. Worth adding a flutter test step in the same job.

3. Conflict with #194. That PR deletes example/lib/purchase_observer.dart and example/lib/screens/main_screen.dart, the exact files touched by the updated legacy demo app commit here, so a textual conflict is guaranteed. The new demo app in #194 has no attribution calls at all, so once both land the API is left without demo coverage.

Nits. The doc comment on appliedExternalAttributionProviders dropped its pointer to the known constants. Removing publish_to: none is worth adding to the release checklist.

Nice touch: pre-encoding the attribution map so a bad payload surfaces as wrongParam instead of internalPluginError, with a test covering it — and keeping the profile wire key untouched, documented explicitly in the CHANGELOG.

@kupriyanovNik

Copy link
Copy Markdown
Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: cd616cdc53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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