If starting the app in CarPlay, Intercom causes the app to crash:
[CPTemplateApplicationScene windows]: unrecognized selector sent to instance
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CPTemplateApplicationScene windows]: unrecognized selector sent to instance 0x103386dc0'
terminating with uncaught exception of type NSException
Previously we haver setup Intercom in AppDelegate, but in preparation for CarPlay, we moved Intercom setup to SceneDelegate, as per the documentation.
Currently the only way to have Intercom be stable, is to uninstall the app and reinstall.
But that user experience is terrible.
Best answer by Anonymous
Hey @emil a. Thanks for reporting this. Can I just replay this to make sure I've understood correctly?
A user has your app installed, and that version of the app initialises the iOS SDK in the AppDelegate.
The user upgrades your app. The new version initialises the iOS SDK in the SceneDelegate and also adds support for CarPlay.
The app works fine on the iPhone but crashes whenever CarPlay is activated.
Uninstalling the app and then installing it again resolves the issue; the iOS SDK works as expected and there's no crash when CarPlay is activated.
Is that right? Is there anything I'm misunderstanding or missing there?
Along with confirming that understanding, it'd be good to understand which version of the iOS SDK you're using, which version of iOS you're seeing the issue with, and, if possible, it'd be good to get hold of the full stack trace. If you're using any wrappers (eg. for Cordova, React Native etc) it'd be good to know which of those you're using as well.
Did this topic help you find an answer to your question?
4 replies
A
Anonymous
0 replies
Answer
March 15, 2021
Hey @emil a. Thanks for reporting this. Can I just replay this to make sure I've understood correctly?
A user has your app installed, and that version of the app initialises the iOS SDK in the AppDelegate.
The user upgrades your app. The new version initialises the iOS SDK in the SceneDelegate and also adds support for CarPlay.
The app works fine on the iPhone but crashes whenever CarPlay is activated.
Uninstalling the app and then installing it again resolves the issue; the iOS SDK works as expected and there's no crash when CarPlay is activated.
Is that right? Is there anything I'm misunderstanding or missing there?
Along with confirming that understanding, it'd be good to understand which version of the iOS SDK you're using, which version of iOS you're seeing the issue with, and, if possible, it'd be good to get hold of the full stack trace. If you're using any wrappers (eg. for Cordova, React Native etc) it'd be good to know which of those you're using as well.
I added CarPlay on the app and I have initialised Intercom on AppDelegate.m inside "didFinishLaunchingWithOptions" method as 'react-native-intercom' package suggests..
If I comment out Intercom, CarPlay works fine, else the app crashes on CarPlay launch ..
In order to add CarPlay I have two Scenes on the App... One for CarPlay(CarPlaySceneDelegate.m) and one for iPhone(SceneDelegate.m)...
( It is interesting that if I open Intercom panel, by calling the 'displayMessageComposer' method, and after that connect to CarPlay, there is no crash. But If I disconnect and connect again to CarPlay with Intercom panel closed, app crashes in the same way. )
I am using React Native "0.63.3", iOS version 14, react-native-intercom "^19.0.0" ..
I already tried to Initialise Intercom on 'SceneDelegate.m' and to use the latest version on 'react-native-intercom' with no success ...
Here is the exact error:
```
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CPTemplateApplicationScene windows]: unrecognized selector sent to instance 0x7f94c2687160'
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.