조회 수 125165 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

carplay01.jpg



Rejoice! Apple finally announced navigation app access for CarPlay in the 2018 WWDC keynote.


Starting with iOS 12, we get access to the CarPlay framework, that lets us draw interface components and functionality for our iOS navigation app on the CarPlay screen.


Setup

You would probably want to start developing right away, right? Hold on a second, unfortunately it’s not that easy. Apple requires developers to apply for access to the entitlements that are needed to run a CarPlay navigation app on a real device. That includes an entitlements key for your XCode project and a provisioning profile that allows signing of CarPlay navigation apps.


However, there is a way to start developing your CarPlay navigation app in the XCode simulator while you are waiting for access. This involves adding a key to your app’s AppName.entitlements file. If you haven’t got such a file in your XCode project yet, see step 1 below, if you do, skip to step 2.


Step 1

To quickly add an entitlements file to your project, go to your app’s target settings in XCode, then to the capabilities tab and for example switch on the Homekit capability. This creates a .entitlements file in your project and routes it for your build system to see. You can add the key from step 2 and then switch off the Homekit capability.


Step 2

I stumbled on this key when trying a lot of variants by trial & error, as I heard that the only thing that it took to test CarPlay Audio apps on the simulator was a com.apple.developer.playable-content key in the entitlements file.


The key that worked was to set com.apple.developer.carplay-maps to true in the entitlements file. If you follow the CarPlay navigation documentation and you have that key present, you can use the XCode 10 beta with the CarPlay simulator (in the Simulator app, go to Hardware → External displays → CarPlay) to test your CarPlay navigation app.



The CarPlay Framework

What Apple cares about in UX is consistency between apps. That is why, for the CarPlay Framework, only the most fundamental interactions are exposed to developers. This is a restriction that is welcoming for our designers, as they have clear boundaries to work with. It also helps developers make safe apps that don’t distract the user too much from looking at the road behind the wheel.


Therefore, the CarPlay Framework is divided by a Template overlay and a CarPlay window separate from your iPhone’s window that you can set a rootViewController property for your ViewController.


CPMapContentWindow:

This window is the place for you to implement your custom views and navigation tiles. You do not seem to be restricted in what you can draw here, however, I assume Apple will be strict in the review process in what they will allow. This is mainly meant to be flexible to allow developers to implement their existing maps, not to go wild with complex User Interactions, as content in the CPMapContentWindow doesn’t accept user interactions. So how would you allow a user to interact with your CarPlay app? That is where Templates come in.


Templates:

A Template overlay is what you give to your CPInterfaceController that is responsible for your user interaction. You can switch between templates, via replacing an interfaceController’s rootTemplate, or by transitioning to another template via an equivalent pushing/popping like the UINavigationController. There are a couple of different Templates to choose from in the current iOS 12 beta build, but the most important one for CarPlay navigation apps is the CPMapTemplate one, as this both displays navigation interface elements to your user and lets the user interact with the map controls, like panning/pinching the map or important alerts with actions.


HelloWorld XCode project

Here you can find my HelloWorld project (see screenshot of it at the beginning of this post) here. All the magic happens in the AppDelegate.swift, though I do not recommend following that lead when developing your own custom CarPlay app. Note: XCode 10 Beta 4 or later is needed to run this project.


Useful links

Some links that could help you get started:

- Documentation for CarPlay navigation apps: https://developer.apple.com/documentation/carplay

- WWDC 2018 video explaining the basis concepts and some common programming examples: https://developer.apple.com/videos/play/wwdc2018/213/

- To apply for your app to be allowed as a CarPlay navigation app: https://developer.apple.com/contact/carplay/


[ref] https://blog.flitsmeister.nl/start-developing-your-navigation-app-for-carplay-6e4c6c2b4e47


?

  1. [ios] Start developing your navigation app for CarPlay without enrollment

    Date2020.02.22 CategoryDevelop Byhooni Views125165
    Read More
  2. [php] 3 Ways to Detect Mobile or Desktop in PHP

    Date2020.01.28 CategoryDevelop Byhooni Views3962
    Read More
  3. 자주 쓰는 Docker 명령어 alias

    Date2020.01.10 CategoryDevelop Byhooni Views270737
    Read More
  4. [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)

    Date2019.12.06 CategoryDevelop Byhooni Views1806
    Read More
  5. [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs)

    Date2019.11.22 CategoryDevelop Byhooni Views1670
    Read More
  6. 링크들 보고 지울 내용

    Date2019.11.21 CategoryDevelop Byhooni Views0
    Read More
  7. [Javascript][Ajax] 자바스크립트 강의 산출물

    Date2019.10.05 CategoryDevelop Byhooni Views787
    Read More
  8. [ios] Locale Identifiers

    Date2018.11.29 CategoryDevelop Byhooni Views1720
    Read More
  9. [ios] Swift 4 Dictionary 사용하기

    Date2018.11.29 CategoryDevelop Byhooni Views2110
    Read More
  10. [ios] Swift 4 Singleton inheritance

    Date2018.10.31 CategoryDevelop Byhooni Views1682
    Read More
  11. [ios] APNS, Remote Push 사용자가 수신을 동의했는지 확인하기

    Date2018.10.19 CategoryDevelop Byhooni Views1349
    Read More
  12. [ios] APNS, Remote Push 수신 시점에서 앱의 3가지 실행 상태

    Date2018.10.19 CategoryDevelop Byhooni Views1073
    Read More
  13. [ios] Swift 4 String, Date, DateFormatter 예제

    Date2018.10.18 CategoryDevelop Byhooni Views1497
    Read More
  14. [ios] Requesting Location Permissions in iOS

    Date2018.08.18 CategoryDevelop Byhooni Views1712
    Read More
  15. [PHP] Mac OS에서 PHP 7 설치하기

    Date2018.05.11 CategoryDevelop Byhooni Views4982
    Read More
  16. [php] Connect to Firebase Console in Laravel

    Date2018.05.09 CategoryDevelop Byhooni Views3207
    Read More
Board Pagination Prev 1 2 3 4 5 ... 53 Next
/ 53