fix(ios): guard preloadKeyboardIfNeeded with @available(iOS 26.0, *)#1448
Open
omnibuild-os wants to merge 1 commit intokirillzyusko:mainfrom
Open
fix(ios): guard preloadKeyboardIfNeeded with @available(iOS 26.0, *)#1448omnibuild-os wants to merge 1 commit intokirillzyusko:mainfrom
omnibuild-os wants to merge 1 commit intokirillzyusko:mainfrom
Conversation
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
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 🤔 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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