Views 124721 Votes 0 Comment 0
Atachment
Attachment '2'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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


?

List of Articles
No. Category Subject Author Date Views
825 Develop SVN 초간단 사용하기 hooni 2014.02.28 7618
824 Develop URI 인코딩, URL 인코딩 file hooni 2013.04.23 18845
823 Develop What is difference between Get, Post, Put and Delete? hooni 2018.02.28 1400
822 Develop XE Core 1.8.18 본문 작성시 태그(html) 사라지는 버그 file hooni 2016.04.21 864
821 Develop XML, JSON, BSON, MSGPACK 장,단점 비교 file hooni 2017.01.11 2239
820 Develop ZBar 라이브러리를 이용한 바코드 스캔 앱 개발하기 file hooni 2015.01.01 1628
819 Develop [ajax] 샘플 코드와 한글처리에 대한 간단한 설명 hooni 2013.04.23 6842
818 Develop [ajax] 이벤트 코드 생성기 작업중.. ㅋㅋ file hooni 2013.04.23 7116
817 Develop [Android Error] The number of method references in a .dex file cannot exceed 64K hooni 2016.11.10 754
816 Develop [Android] 2010년에 만들었던 세미나 자료. file hooni 2013.05.28 64661
815 Develop [android] AlertDialog 메시지 창 띄우기 hooni 2015.07.09 849
814 Develop [android] Android N requires the IDE to be running with Java 1.8 or later 오류 hooni 2016.08.30 684
813 Develop [android] ArrayAdapter 테스트 파일 ㅎㅎ hooni 2013.04.23 45239
812 Develop [android] ArrayAdapter를 이용하여 출력하기 hooni 2013.04.23 47337
811 Develop [android] Calling activity function from separate class hooni 2016.11.15 1155
810 Develop [android] Canvas를 이용해 이미지 확대/축소 하기 hooni 2013.04.23 60741
Board Pagination Prev 1 2 3 4 5 ... 53 Next
/ 53