birkir / react-native-carplay

CarPlay with React Native
https://birkir.dev/react-native-carplay/
MIT License
625 stars 103 forks source link

Fix iOS-app crashing when connecting an external display #168

Closed DanielKuhn closed 4 months ago

DanielKuhn commented 4 months ago

External display connection invokes scene:willConnectTo:options again with the session role .windowExternalDisplayNonInteractive:https://developer.apple.com/documentation/uikit/windows_and_screens/presenting_content_on_a_connected_display

This needs to be explicitly handled or rejected, otherwise the app crashes with the error: Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time!'

DanielKuhn commented 4 months ago

This should also be updated in the README - maybe while converting the example code in the README to Swift.