Skip to content

fix(ios): guard preloadKeyboardIfNeeded with @available(iOS 26.0, *)#1448

Open
omnibuild-os wants to merge 1 commit intokirillzyusko:mainfrom
omnibuild-os:fix/ios-26-keyboard-preload-availability
Open

fix(ios): guard preloadKeyboardIfNeeded with @available(iOS 26.0, *)#1448
omnibuild-os wants to merge 1 commit intokirillzyusko:mainfrom
omnibuild-os:fix/ios-26-keyboard-preload-availability

Conversation

@omnibuild-os
Copy link
Copy Markdown

Problem

On iOS 26+, calling [UIResponder preloadKeyboardIfNeeded] crashes because it is treated as a private API on that OS version.

Fix

Guard the call with @available(iOS 26.0, *) so it is skipped on iOS 26 and later. When running on iOS 26+, the method returns early without calling the private API.

- (void)preload
{
  if (@available(iOS 26.0, *)) {
    return;
  }
  [UIResponder preloadKeyboardIfNeeded];
}

Context

This was discovered in a production React Native application that began crashing on iOS 26 beta devices. A local patch has been in use as a workaround while awaiting an upstream fix.

Testing

  • Tested on iOS 26 simulator — no crash on keyboard preload
  • Tested on iOS 17 device — keyboard preload continues to work as expected

On iOS 26+, `[UIResponder preloadKeyboardIfNeeded]` is a private API that
causes a crash. Guard the call so it is skipped on iOS 26 and later.

Fixes: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/preload-crash-ios26
@kirillzyusko
Copy link
Copy Markdown
Owner

Hey @omnibuild-os

Could you please add logs with the crash?.. It's really weird that this code causes a crash because I use only public API for that 🤔

@kirillzyusko kirillzyusko self-requested a review April 30, 2026 18:12
@kirillzyusko kirillzyusko self-assigned this Apr 30, 2026
@kirillzyusko kirillzyusko added 🍎 iOS iOS specific 🎯 crash Library triggers a crash of the app labels Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎯 crash Library triggers a crash of the app 🍎 iOS iOS specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants