"Unable to Connect Error" on below iOS14 for carplay audio apps

36 Views Asked by At

I am trying to build a audio app which supports from iOS 13 and above.

iOS 13 - com.apple.developer.playable-content, iOS 14 - com.apple.developer.carplay-audio I have added above entitlements to support my app for below and above iOS 14 version.

<key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <false/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>CPTemplateApplicationSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneClassName</key>
                    <string>CPTemplateApplicationScene</string>
                    <key>UISceneConfigurationName</key>
                    <string>CarPlay</string>
                    <key>UISceneDelegateClassName</key>
                    <string>$(PRODUCT_MODULE_NAME).CarSceneDelegate</string>
                </dict>
            </array>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneClassName</key>
                    <string>UIWindowScene</string>
                    <key>UISceneConfigurationName</key>
                    <string>Phone</string>
                    <key>UISceneDelegateClassName</key>
                    <string>$(PRODUCT_MODULE_NAME).PhoneSceneDelegate</string>
                </dict>
            </array>
        </dict>
    </dict>
</dict>
</plist>

This is how I added UIApplicationSceneManifest but problem here is that when we launch app on below ios14 im getting "Unable to Connect Error" enter image description here

But if i add maps support entitlements i can able to render Grid or list templates. So My question is how to add support for below and above iOS14 versions for audio app in same code base.

1

There are 1 best solutions below

1
Farrukh Makhmudov On

You should add both keys for ios 13 and ios 14 configuration. UIWindowSceneSessionRoleApplication is for ios 13 and CPTemplateApplicationSceneSessionRoleApplication is for 14.

<key>UIApplicationSceneManifest</key>
<dict>
    <key>UIApplicationSupportsMultipleScenes</key>
    <false/>
    <key>UISceneConfigurations</key>
    <dict>
        <key>CPTemplateApplicationSceneSessionRoleApplication</key>
        <array>
            <dict>
                <key>UISceneClassName</key>
                <string>CPTemplateApplicationScene</string>
                <key>UISceneConfigurationName</key>
                <string>CarPlay</string>
                <key>UISceneDelegateClassName</key>
                <string>$(PRODUCT_MODULE_NAME).CarSceneDelegate</string>
            </dict>
        </array>
        <key>UIWindowSceneSessionRoleApplication</key>
        <array>
            <dict>
                <key>UISceneClassName</key>
                <string>UIWindowScene</string>
                <key>UISceneConfigurationName</key>
                <string>Phone</string>
                <key>UISceneDelegateClassName</key>
                <string>$(PRODUCT_MODULE_NAME).PhoneSceneDelegate</string>
            </dict>
        </array>

        <key>UIWindowSceneSessionRoleApplication</key>
        <array>
            <dict>
                <key>UISceneClassName</key>
                <string>UIWindowScene</string>
                <key>UISceneConfigurationName</key>
                <string>Default Configuration</string>
                <key>UISceneDelegateClassName</key>
                <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
            </dict>
        </array>
    </dict>
</dict>