Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for CPTemplateApplicationSceneDelegate UIScene-based CarPlay on iOS 13 and above #2832

Merged
merged 8 commits into from
Apr 6, 2021

Conversation

avi-c
Copy link
Contributor

@avi-c avi-c commented Feb 24, 2021

Description

In iOS 13 Apple added a Template-based mechanism for providing CarPlay support to apps. The Nav SDK needs to include support for these newer APIs while ensuring we don't break the earlier iOS 12 CarPlay delegate pattern until we drop support for iOS 12.

Fixes #2260

Implementation

The changes required within the Nav SDK are fairly minimal, mainly adding conformance to the CPTemplateApplicationSceneDelegate protocol. More extensive changes are needed to the Example app in order to adopt UIScene support.

@avi-c avi-c marked this pull request as draft February 24, 2021 22:17
@avi-c
Copy link
Contributor Author

avi-c commented Feb 24, 2021

The initial version of the PR adds the Nav SDK support. I'm putting it up as a draft PR to get comments before doing all the work to convert the Example app to use UIScene templates for CarPlay.

@avi-c avi-c requested a review from 1ec5 February 24, 2021 22:18
@avi-c
Copy link
Contributor Author

avi-c commented Feb 25, 2021

Added UIScene and CPTemplateApplicationSceneDelegate support to the Example app for iOS 13 and above. Allows us to use newer iOS 13 CarPlay SDK.

@avi-c avi-c marked this pull request as ready for review February 25, 2021 22:33
@avi-c avi-c requested review from 1ec5 and removed request for 1ec5 February 26, 2021 18:06
@1ec5 1ec5 added feature New feature request. CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Feb 27, 2021
@avi-c avi-c force-pushed the ac-CarPlayUISceneSupport branch from 1123295 to 4632205 Compare March 1, 2021 18:12
@@ -901,7 +901,7 @@
C53C19751F38EADE008DB406 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
C53C19771F38EAE4008DB406 /* ca */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
C53C197A1F38EAEA008DB406 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
C53F2F0720EBC95600D9798F /* Example-CarPlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-CarPlay.app"; sourceTree = BUILT_PRODUCTS_DIR; };
C53F2F0720EBC95600D9798F /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
Copy link
Contributor

@1ec5 1ec5 Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, this means it isn’t possible to install the normal Example and CarPlay-enabled Example applications simultaneously on a single device or simulator. Not a huge deal, but it may be surprising at first.

/**
CarPlay support requires iOS 12.0 or above and the CarPlay framework.
*/
public class CarPlayManager: NSObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, jazzy will stop warning about missing USRs for these conditionally compiled symbols. 😌

/ref #2078

@avi-c avi-c force-pushed the ac-CarPlayUISceneSupport branch from 008d3a5 to 7c35d5d Compare April 6, 2021 17:24
@avi-c
Copy link
Contributor Author

avi-c commented Apr 6, 2021

Made the change to the CHANGELOG entry as requested and rebased to main

@avi-c avi-c merged commit efac4a4 into main Apr 6, 2021
@avi-c avi-c deleted the ac-CarPlayUISceneSupport branch April 6, 2021 18:03
avi-c added a commit that referenced this pull request May 9, 2021
…d CarPlay on iOS 13 and above (#2832)

* Add support for UIScene-based CarPlay API.
avi-c added a commit that referenced this pull request May 15, 2021
…d CarPlay on iOS 13 and above (#2832)

* Add support for UIScene-based CarPlay API.
avi-c added a commit that referenced this pull request May 27, 2021
…d CarPlay on iOS 13 and above (#2832)

* Add support for UIScene-based CarPlay API.
avi-c added a commit that referenced this pull request Jun 15, 2021
…d CarPlay on iOS 13 and above (#2832)

* Add support for UIScene-based CarPlay API.
avi-c added a commit that referenced this pull request Jul 14, 2021
…d CarPlay on iOS 13 and above (#2832)

* Add support for UIScene-based CarPlay API.
@1ec5 1ec5 mentioned this pull request Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CarPlay Bugs, improvements and feature requests on Apple CarPlay feature New feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure compatibility with CPTemplateApplicationSceneDelegate
2 participants