You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KorotkovAlex
changed the title
Send NString to a reject function instead of NSException
Send NString to a reject function instead of NSException. React-Native 0.79
Jun 9, 2025
I can confirm - reject on 0.79 bridgeless crashes the app if NSException is passed instead of NSString.
Changing to e.description has fixed it for me.
Also, API of reject has expected NSString for few years already so it means that the mapping layer has become stricter in 0.79 but merging it shouldn't cause any problems on older versions
We encountered a very similar crash in an Expo SDK 56 application using React Native 0.85.3 with the New Architecture enabled.
The crash occurred when an iOS audio route operation failed inside setAudioRoute or getAudioRoutes. RNCallKeep passed the caught NSException directly as the Promise rejection message. With the newer React Native TurboModule error conversion, the runtime expected an NSString and attempted to call UTF8String on the NSException, resulting in:
-[NSException UTF8String]: unrecognized selector sent to instance
Our local workaround was to pass e.description (or an equivalent NSString) to reject instead of the exception object. We also delayed application-level audio route changes until didActivateAudioSession, since CallKit may not have activated the AVAudioSession yet. The latter is app-side timing, but the rejection conversion is a library issue.
This PR would help us and other applications using current React Native versions significantly. Thank you for putting together the fix.
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
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.
In react-native 0.79 reject interface are changed. We should send NSString instead of NSException