Skip to content

docs(docs): correct and clarify the iOS integration guides [NT-3943] - #434

Draft
David Nalchevanidze (nalchevanidze) wants to merge 1 commit into
mainfrom
nt-3943-ios-guides-review
Draft

docs(docs): correct and clarify the iOS integration guides [NT-3943]#434
David Nalchevanidze (nalchevanidze) wants to merge 1 commit into
mainfrom
nt-3943-ios-guides-review

Conversation

@nalchevanidze

@nalchevanidze David Nalchevanidze (nalchevanidze) commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

End-to-end accuracy and reader-experience pass over both iOS integration guides (NT-3943, sub-task of NT-3896).

knowledge:check and guides:check were already green before this branch, so none of these defects were mechanically detectable — they came out of a cold newcomer read plus claim-by-claim verification against the Swift source and the internal fact store.

Correctness

  • Four snippets could not compile. OptimizedEntry argument order (both initializers declare dwellTimeMs before minVisibleRatio, and Swift enforces declaration order), the missing hasConsent(method:) label, and absent Combine / Contentful imports. The first two were inherited from prose shared with the Android guides, where both forms are legal Kotlin — Swift is the only target where they break.
  • UIKit consent gap. The guide called StorageDefaults(consent: true) a "seed" and never stated that a configured value overrides a stored user choice on every launch. A reader carrying the quick-start config into an app that later collects consent got no warning. The SwiftUI guide already stated this correctly, so the two siblings disagreed.
  • Seven contradicted behavioral claims corrected, including a false tree-wide tap opt-out (a descendant onTap re-enables tracking), background flush described as UIKit-only when the gate is canImport(UIKit), and a preview-panel claim that only holds for SwiftUI.
  • Four facts the knowledge base already held but the guides omitted.

Reader path

  • Both fetch sections described a CDA query in prose and contained no fetch code, despite that being their entire reader goal. They now carry real contentful.swift queries, verified member-by-member against the vendored checkout.
  • Every entry example leads with Contentful.Entry; the still-supported dictionary overload keeps one sentence.
  • The quick start named a clientId it never sourced — provenance is now inline where it is first needed.
  • UIKit snippets are placeable in a real file (hosted #if DEBUG block, wrapped await, lock-example call site), the storyboard-rooted case has an injection path that does not crash, and the view-tracking example wires its disappear path.
  • Missing Troubleshooting rows and undefined load-bearing terms added.

Validation

  • pnpm guides:check — pass
  • pnpm knowledge:check — pass (1417 pointers, 10 fact files)
  • pnpm exec prettier --check — clean
  • Guide headings are byte-identical to main, so every table-of-contents anchor and inbound deep link still resolves.

Swift snippets are symbol-verified against source, not compiler-verified — no Xcode run in this environment.

Open items (not in this PR)

  • The from: "<version>" placeholder in both guides is unfixed, pending confirmation of the published optimization.swift tag naming and whether from: or exact: is correct for a prerelease.
  • Whether import Contentful resolves in a consumer target declaring only ContentfulOptimization is unconfirmed; the new Troubleshooting row is worded to be correct either way.
  • Raised for the core-analytics owners: shared/concepts.md says getFlag(name) tracks a flag-view exposure immediately, native/ios.md says only subscribing does. iOS getFlag bridges that same shared core, so one is wrong. If concepts.md governs, both guides advise a pattern that silently generates billable exposures — and the same advice propagates to every SDK guide bridging the core.
  • Follow-up ticket candidates: OptimizationConfig.environment defaults to main while ContentfulHTTPPreviewClient.environment defaults to master; trackCurrentScreen is the guides' recommended screen API but is called by no reference implementation, so XCUITest cannot regress the documented path; and ViewTrackingController / TrackingMetadata accept only dictionaries, forcing UIKit apps to hand-encode a typed entry.

Deliberately unchanged: table-of-contents placement and Before you start ordering (archetype-wide, shared by all 10 integration guides), and credential links (that sentence is duplicated verbatim across 6 guides and is not a fragment, so it belongs to the parent ticket).

🤖 Generated with Claude Code

Review both iOS guides against the current SDK surface and fix what the
mechanical validators cannot catch.

Correctness:
- Fix four snippets that could not compile: OptimizedEntry argument order,
  the missing hasConsent(method:) label, and the absent Combine and
  Contentful imports. The first two were inherited from prose shared with
  the Android guides, where both forms are legal Kotlin.
- State in the UIKit guide that StorageDefaults is a startup default rather
  than a one-time seed, so a configured value replaces a stored user choice
  on every launch. The SwiftUI guide already said this; the siblings
  disagreed.
- Correct seven contradicted behavioral claims and carry four facts that
  the knowledge base already held.

Reader path:
- Give both fetch sections real contentful.swift queries; they previously
  described a CDA query in prose only.
- Lead every entry example with Contentful.Entry, keeping one sentence for
  the still-supported dictionary overload.
- Name where the client ID comes from at the point the quick start asks for
  it, add a configured contentful.swift client as a prerequisite, show a
  storyboard-friendly injection path, and make the UIKit snippets placeable
  in a real file.
- Add the missing Troubleshooting rows and gloss the load-bearing terms.

Guide headings are unchanged, so every table-of-contents anchor still
resolves. Open items, follow-up tickets, and the getFlag exposure conflict
raised for the core analytics owners are recorded in
nt-3943-ios-guides-review.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant