fix(ios): make private API calls static for App Store 2.5.2
Merged
RI
1mo ago+113+113+012345678901234567890123456789-15-15-01234567890123456789
What
- Restore existing Capacitor iOS private integration behavior (status bar tap swizzle, WKContentView focus swizzle, optional SSL pinning class lookup, plugin navigation/auth hooks).
- Centralize private class and selector names in
CAPAppStorePrivateAPIand use compile-time constants (static let,#selector,@selector) instead of runtime-built strings. - Add
scripts/check-ios-dynamic-dispatch.mjsto fail CI when obfuscated runtime dispatch patterns return.
Why
- App Store guideline 2.5.2 review flags dynamic dispatch and obfuscated private API lookups. Behavior stays the same; only how names are resolved changes.
How
UIStatusBarManager+CAPHandleTapAction.m: forward declarehandleTapAction:and use@selector(handleTapAction:).WKWebView+Capacitor.swift:NSClassFromString(CAPAppStorePrivateAPI.wkContentViewClassName)and staticSelector(...)for_elementDidFocus:...(noWK+ContentViewconcatenation, nosel_getUid).WebViewDelegationHandler.swift:responds(to:)with#selector(CAPPlugin...)constants fromCAPAppStorePrivateAPI.CapacitorHttp.swift:NSClassFromStringwith static class name constant and#selector(CAPHttpPlugin.request(_:)).- Each private call site tagged with
// appstore-2.5.2-allow: <reason>.
Upstream sync notes
- Re-apply
CAPAppStorePrivateAPI.swiftand static-name edits if upstream reverts to inlineNSSelectorFromString/ string concatenation in these files. - Keep the checker in
iosverifyafter sync merges.
Testing
node scripts/check-ios-dynamic-dispatch.mjs- CI
bun run verifyinios(xcodebuild test)
Not Tested
- Physical device App Store static analysis (scanner behavior is external).


Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by CodeRabbit
- New Features
- iOS apps can now support optional SSL-pinning request handlers.
- Web views respect the configured zoom setting and allow users to scroll to the top by tapping the status bar.
- Bug Fixes
- Improved application of keyboard interaction settings in iOS web views, including after page navigation, so configured keyboard behavior is applied more consistently.
- Improved handling of web view scrolling and zoom gestures across supported configurations.