Skip to content

fix(ios): Guard newer APIs for older SDK compatibility - #34

Merged
CAWRESTLER merged 3 commits into
CAWRESTLER:mainfrom
alieldab3:fix/older-ios-sdk-compatibility
Nov 11, 2026
Merged

CAWRESTLER merged 3 commits into
CAWRESTLER:mainfrom
alieldab3:fix/older-ios-sdk-compatibility

Conversation

@alieldab3

Copy link
Copy Markdown
Contributor

fix(ios): Guard newer APIs for older SDK compatibility

Summary

  • Add compile-time guards around iOS 27.0 and 27.1 APIs while preserving runtime availability checks.
  • Retain older-SDK fallbacks and accurately report unsupported Duo capabilities.
  • Preserve Duo functionality on supported SDK/runtime combinations.
  • Normalize added preprocessor directives to column 1.

Validation

  • Consuming-app simulator builds succeeded with Xcode 26.3 and 27.1.
  • The 26.3-built app launched on a standard iPhone simulator.
  • git diff --check passed.
  • All 19 focused native policy tests passed.
  • SDK guard preprocessing checks passed for 26.3, 27.0, and 27.1.
  • Full tooling suite: 58/59 passed; one failed because the example's Expo dependency was missing.

Limitations

  • Preprocessing checks do not replace full native builds.
  • Duo folding and physical hardware behavior remain untested.
  • SDKs predating iOS 26 are not covered by this compatibility claim.

Add `RNDUO_HAS_IOS_27_SDK` and `RNDUO_HAS_IOS_27_1_SDK` compile-time checks and use them across Duo iOS views/utilities to wrap 27.0/27.1-only types, properties, and methods. This keeps runtime `@available` behavior but prevents references to unavailable symbols when building with older SDKs. The fallback paths remain active, including clearer unsupported-camera messaging when 27.1 APIs are not present.
@alieldab3
alieldab3 requested a review from CAWRESTLER as a code owner October 26, 2026 12:46

@CAWRESTLER CAWRESTLER left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this, @alieldab3! The guard approach looks right and CI is green on Xcode 27.1. Two small things before I merge:

  1. Unused static helpers on older SDKs. In ios/RNDuoArrangementView.mm, RNDuoAxes and RNDuoOverlayEdge are only called from code that's now inside the iOS 27 compile-time guard, so on older Xcode they're unused and trigger -Wunused-function. That will break builds for apps compiling with -Werror. Could you wrap those two helpers in the same #if guard?
  2. Branch is behind main. Please update/rebase onto the latest main so the required checks can run against it.

Optional, fine as a follow-up: the README, docs/COMPATIBILITY.md, and CHANGELOG still say Xcode 27.1 is required to compile. With this PR, older Xcode builds succeed and report Duo features as unavailable, so a note there would help. I can handle that after merge if you'd rather not.

Thanks again for the contribution!

Wrap Duo-only static helper functions in `RNDuoArrangementView.mm` with `RNDUO_HAS_IOS_27_1_SDK` so native iOS code can compile against older SDKs. Update README, CHANGELOG, and compatibility docs to clarify the new behavior: older-SDK builds keep fallback UI paths and report Duo APIs as unsupported, while native Duo features still require building with the iOS 27.1 SDK and running on iOS 27.1+.
@alieldab3

Copy link
Copy Markdown
Contributor Author

Thanks @CAWRESTLER for the review! Both helpers are now wrapped in the same SDK guard, and I’ve updated the README, compatibility guide, and changelog to clarify older-SDK fallback behavior.

I also fetched the latest upstream main and confirmed it’s already included in this branch through the existing merge. All 19 focused native tests and git diff --check pass.

I’ll commit and push these local updates so CI can rerun.

@alieldab3
alieldab3 requested a review from CAWRESTLER November 4, 2026 15:34

@CAWRESTLER CAWRESTLER left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @alieldab3! Both helpers are guarded, the docs are updated, and CI is green on all platforms. Merging.

@CAWRESTLER
CAWRESTLER merged commit f08d684 into CAWRESTLER:main Nov 11, 2026
8 checks passed
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