I have an app in CarPlay where i was pushing the CPNowPlayingTemplate as follows:
self.interfaceController.pushTemplate(CPNowPlayingTemplate.shared(), animated: true)
This used to work perfectly, but suddenly I have started to get this error
NSInvalidArgumentException: Unsupported object passed to pushTemplate:animated:completion:. Allowed classes: {(
CPActionSheetTemplate,
CPAlertTemplate,
CPVoiceControlTemplate,
CPTabBarTemplate,
CPListTemplate,
CPInformationTemplate,
CPContactTemplate,
CPMapTemplate,
CPGridTemplate,
CPSearchTemplate
)}
How is this possible? Even on Apple docs, it says to pushTemplate
Refer
Note:
I have a max of 3 templates going on:
- Home screen
- Album screen with all songs
- NPS now playing screen
I have the following entitlement also:
com.apple.developer.carplay-audio
The issue is not reproducible on local xCode but when i deployed to appStore it started showing this exception.