Hi, the SDK crash if I try to start a CarPlay app.
The error is
[CPTemplateApplicationScene windows]: unrecognized selector sent to instance 0x1228ef470
The error is thrown from login method:
Intercom.loginUser(with: attributes, completion: nil)
Hi, the SDK crash if I try to start a CarPlay app.
The error is
[CPTemplateApplicationScene windows]: unrecognized selector sent to instance 0x1228ef470
The error is thrown from login method:
Intercom.loginUser(with: attributes, completion: nil)
Best answer by User1891
I believe this issue is caused by the SDK assuming that all scenes returned from `UIApplication.shared.connectedScenes` are `UIWindowScene`’s, but that is not the case.
I suspect that this issue could be fixed by filtering to only the connected scenes like so:
let windowScenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }
// Now each window scene will have a windows property
// which you can access without crashing.
_ = windowScenes.first?.windows
Here is a temporary workaround that consumers of the SDK can use while waiting for a fix:
extension CPTemplateApplicationScene {
@objc var windows: UIWindow? { nil }
}
It works by defining the missing property and exposing it to Objective-C.
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.