Enabling Your App for CarPlay

Similar documents
Introduction to Siri Shortcuts

CarPlay Audio and Navigation Apps

CarPlay Navigation App Programming Guide. September 28, 2018

Extending Your Apps with SiriKit

What s New in Xcode App Signing

Enhancing your apps for the next dimension of touch

What s New in watchos

Using and Extending the Xcode Source Editor

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer

Building for Voice with Siri Shortcuts

Introducing SiriKit. Hey Siri, say hello to apps #WWDC16. App Frameworks. Session 217

What s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer

Media and Gaming Accessibility

Quick Interaction Techniques for watchos

Introducing Password AutoFill for Apps

What s New in SiriKit

WatchKit In-Depth, Part 2

USER GUIDE. Apple CarPlay

Modern User Interaction on ios

What s New in Energy Debugging

Getting the Most Out of HealthKit

Managing Documents In Your ios Apps

Introducing MusicKit. Media #WWDC17. Tim Parthemore, MusicKit Services Joel Lopes Da Silva, ios Music

Data Delivery with Drag and Drop

Basic HFL Operation Models with Display Audio

Mastering UIKit on tvos

Creating Audio Apps for watchos

Building Faster in Xcode

What s New in SpriteKit

Localizing with Xcode 9

What s New in Testing

Your Apps and the Future of macos Security

CS193P - Lecture 16. iphone Application Development. Audio APIs Video Playback Displaying Web Content Settings

Mastering Drag and Drop

What s New in Audio. Media #WWDC17. Akshatha Nagesh, AudioEngine-eer Béla Balázs, Audio Artisan Torrey Holbrook Walker, Audio/MIDI Black Ops

Adjusting the Sound Adjust various sound settings.

Touch Bar Fundamentals

Core ML in Depth. System Frameworks #WWDC17. Krishna Sridhar, Core ML Zach Nation, Core ML

Display Audio Operation

Implementing UI Designs in Interface Builder

MITSUBISHI MOTORS NORTH AMERICA, INC. SMARTPHONE LINK DISPLAY AUDIO SYSTEM (SDA) QUICK REFERENCE GUIDE FOR ANDROID USERS

Using Grouped Notifications

lecture 10 UI/UX and Programmatic Design cs : spring 2018

Apple Watch Design Tips and Tricks

MITSUBISHI MOTORS NORTH AMERICA, INC. SMARTPHONE LINK DISPLAY AUDIO SYSTEM (SDA) QUICK REFERENCE GUIDE FOR APPLE CARPLAY USERS

Smart Music Control Application

Writing Energy Efficient Apps

Advances in AVFoundation Playback

Automatic Strong Passwords and Security Code AutoFill

What s New in Core Data?

Via Bluetooth. Compatibility and connection

Navi 900 IntelliLink, Touch R700 IntelliLink Frequently Asked Questions

What s New in tvos 12

Understanding Undefined Behavior

What s New in Swift Playgrounds

Apple CarPlay. Quick Start Guide AUDIO SYSTEMS VIDEO

Thread Sanitizer and Static Analysis

What s New in imessage Apps

Accessibility on ios. Developing for everyone. Frameworks #WWDC14. Session 210 Clare Kasemset ios Accessibility

Improving your Existing Apps with Swift

Advanced Notifications

Designing for Apple Watch

Introducing On Demand Resources

Building Apps with Dynamic Type

Portable media PORTABLE MEDIA CONNECTIONS

AUDIO AND CONNECTIVITY

Content Protection for HTTP Live Streaming

BT One Phone SIP Softphone Application. Quick User Guide IOS

Adapting to the New UI of OS X Yosemite

Mastering Xcode for iphone OS Development Part 2. Marc Verstaen Sr. Manager, iphone Tools

New UIKit Support for International User Interfaces

Accessibility on OS X

Voice command system. & Using the voice command. system. NOTE

GET STARTED. Apple CarPlay COMPATIBILITY.

Advances in TVMLKit. App Frameworks #WWDC17. Trevor Cortez, Localization Engineer Parry Panesar, tvos Engineer Jeremy Foo, tvos Engineer

What s New in CloudKit

BT One Phone SIP Softphone Application. Quick User Guide

Getting Started. Overview CHAPTER

App Extension Best Practices

Display Audio Operation

Building Visually Rich User Experiences

Siri/VOICE RECOGNITION

Sprint Direct Connect Now 3.0

Stream iphone Sensor Data to Adafruit IO

Getting Started. Overview CHAPTER

Introducing Metal 2. Graphics and Games #WWDC17. Michal Valient, GPU Software Engineer Richard Schreyer, GPU Software Engineer

ipod shuffle User Guide

Easy to use, simple, reliable

All rights reserved. Under the copyright laws, this manual may not be copied, in whole or in part, without the written consent of Garmin.

Optimizing Swift Performance Session 409

Models with Display Audio Basic HFL Operation

What s New in ARKit 2

New Ways to Work with Workouts

SceneKit in Swift Playgrounds

Seamless Linking to Your App

ios 12 beta Release Notes

ZEED T-Connect User Guide for DA Linkage

Introducing Swift Playgrounds

What s New in Device Configuration, Deployment, and Management

Studio 5.5. User Manual

Transcription:

Session App Frameworks #WWDC17 Enabling Your App for CarPlay 719 Albert Wan, CarPlay Engineering 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Agenda How apps run in CarPlay CarPlay app integration

How Apps Run in CarPlay

Features Available to All Apps in CarPlay Now Playing information and playback controls Audio plays through car s speakers SiriKit (for appropriate intents)

Best Practices for All Apps Don t play audio automatically unless requested Configure the audio session

Best Practices for All Apps Don t play audio automatically unless requested Configure the audio session Spoken audio apps AVAudioSessionModeSpokenAudio

Best Practices for All Apps Don t play audio automatically unless requested Configure the audio session Spoken audio apps AVAudioSessionModeSpokenAudio Navigation apps AVAudioSessionModeSpokenAudio AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers Set mixable before making audio active

CarPlay Enabled Apps Appear on the CarPlay home screen Run in the foreground on both screens

CarPlay Enabled Apps Supported app categories Audio apps Messaging and VoIP calling apps Automaker apps Request CarPlay entitlement http://developer.apple.com/carplay Entitlement setup and provisioning

Designing for CarPlay For icon guidance, see App Icon in ios Human Interface Guidelines For design guidelines, see CarPlay Human Interface Guidelines

Xcode and Simulator Audio limitations (playback state) Test on device and with an actual head unit Wireless debugging in Xcode Debugging with Xcode 9 Hall 2 Wednesday 10:00AM

Data Protection Apps can run in CarPlay while the iphone is passcode locked Passcode protected data may be unavailable

Data Protection Apps can run in CarPlay while the iphone is passcode locked Passcode protected data may be unavailable Files FileProtectionType.complete FileProtectionType.completeUnlessOpen

Data Protection Apps can run in CarPlay while the iphone is passcode locked Passcode protected data may be unavailable Files Keychain FileProtectionType.complete FileProtectionType.completeUnlessOpen ksecattraccessiblewhenpasscodesetthisdeviceonly ksecattraccessiblewhenunlocked ksecattraccessiblewhenunlockedthisdeviceonly

Data Protection Apps can run in CarPlay while the iphone is passcode locked Passcode protected data may be unavailable Files Keychain SQLite FileProtectionType.complete FileProtectionType.completeUnlessOpen ksecattraccessiblewhenpasscodesetthisdeviceonly ksecattraccessiblewhenunlocked ksecattraccessiblewhenunlockedthisdeviceonly SQLITE_OPEN_FILEPROTECTION_COMPLETE SQLITE_OPEN_FILEPROTECTION_COMPLETEUNLESSOPEN

CarPlay App Integration

CarPlay App Integration Audio Apps Messaging and VoIP Calling Apps Automaker Apps

Audio Apps

Audio Apps

Audio Apps 800 x 480 hero shot of audio app Now Playing view Probably Podcasts app

Requirements for Audio Apps Implement the MPPlayableContent API MPPlayableContentDataSource, MPPlayableContentDelegate Respond to MPRemoteCommandCenter events Update MPNowPlayingInfoCenter

Building the Data Source Running Eye of the Tiger Playlists Afternoon Jams The Chainsmokers Artists Macklemore Shake It Off Taylor Swift Fifteen Albums Little Voice

contentitem at (0, 0) (0) Running (0, 0) Eye of the Tiger (0, 0, 0) Playlists Afternoon Jams (0, 1) The Chainsmokers (1, 0) (1) Artists Macklemore (1, 1) (1, 2) Shake It Off (1, 2, 0) Taylor Swift (2) Fifteen (1, 2, 1) Albums Little Voice (2, 0)

contentitem at (0, 0) (0) Running (0, 0) Eye of the Tiger (0, 0, 0) Playlists Afternoon Jams (0, 1) The Chainsmokers (1, 0) (1) Artists Macklemore (1, 1) (1, 2) Shake It Off (1, 2, 0) Taylor Swift (2) Fifteen (1, 2, 1) Albums Little Voice (2, 0)

numberofchilditems at (1,2) (0) Running (0, 0) Eye of the Tiger (0, 0, 0) Playlists Afternoon Jams (0, 1) The Chainsmokers (1, 0) (1) Artists Macklemore (1, 1) (1, 2) Shake It Off (1, 2, 0) Taylor Swift (2) Fifteen (1, 2, 1) Albums Little Voice (2, 0)

numberofchilditems at (1,2) (0) Running (0, 0) Eye of the Tiger (0, 0, 0) Playlists Afternoon Jams (0, 1) The Chainsmokers (1, 0) (1) Artists Macklemore (1, 1) (1, 2) Shake It Off (1, 2, 0) Taylor Swift 2 Children (2) Fifteen (1, 2, 1) Albums Little Voice (2, 0)

Content Limits Content limits may be enforced that can truncate the number of rows and container depth Take changes into account with MPPlayableContentManager

extension YourAppContentManager : MPPlayableContentDelegate { // called whenever CarPlay state changes func playablecontentmanager( _ contentmanager: MPPlayableContentManager, didupdate context: MPPlayableManagerContext) { // check to see if content limits are enforced let contentlimitsenforced = context.contentlimitsenforced if contentlimitsenforced { // the maximum number of items shown in a list when content limits are enforced let contentlimititemcount = context.enforcedcontentitemscount // the maximum depth in the hierarchy when content limits are enforced let contentlimittreedepth = context.enforcedcontenttreedepth } else { } } }

Tabs Tabs Add UIBrowsableContentSupportsSectionedBrowsing to Info.plist Recommended to have at most 4 tabs for space constraints Keep tab titles as short as possible for narrow screens and Now Playing button Tab image assets will be rendered as template images

Now Playing Screen

// Set Metadata to be Displayed in Now Playing Info Center let infocenter = MPNowPlayingInfoCenter.default() infocenter.nowplayinginfo = [MPMediaItemPropertyTitle: "Style", MPMediaItemPropertyArtist: "Taylor Swift", MPMediaItemPropertyAlbumTitle: "1989", MPMediaItemPropertyGenre: "Pop", MPMediaItemPropertyReleaseDate: "2014", MPMediaItemPropertyPlaybackDuration: 231, MPMediaItemPropertyArtwork: mediaitemartwork, MPNowPlayingInfoPropertyElapsedPlayback: 53, MPNowPlayingInfoPropertyDefaultPlaybackRate: 1, MPNowPlayingInfoPropertyPlaybackRate: 1, MPNowPlayingInfoPropertyPlaybackQueueCount: 13, MPNowPlayingInfoPropertyPlaybackQueueIndex: 3, ]

Playback Controls MPRemoteCommandCenter Play, pause, stop Previous track, next track Seek backward, seek forward Skip backward, skip forward Shuffle, repeat Like, dislike, bookmark Change playback rate

Changing Playback Rate NEW Add default playback rate to MPNowPlayingInfoCenter: MPNowPlayingInfoPropertyDefaultPlaybackRate Implement changeplaybackratecommand with supportedplaybackrates in MPRemoteCommandCenter

// Change Playback Rate let infocenter = MPNowPlayingInfoCenter.default() infocenter.nowplayinginfo = [MPNowPlayingInfoPropertyDefaultPlaybackRate: 1.0, ] let changeplaybackratecommand = MPRemoteCommandCenter.shared().changePlaybackRateCommand changeplaybackratecommand.supportedplaybackrates = [0.5, 1.0, 1.5, 2.0]

Playback Controls If multiple commands are specified, CarPlay may combine them into a single button

Playback Controls If multiple commands are specified, CarPlay may combine them into a single button

Best Practices Call the completion handler when content is ready to play or be displayed Return at least one row in the root table view for non-tabbed apps If your app has initial setup, populate the first row with an MPContentItem that is neither playable nor a container indicating the state of the app to the user

Messaging and VoIP Calling Apps Chris Whitney, CarPlay Engineering

Messaging and VoIP Calling Apps

Requirements for Messaging and VoIP Calling Apps

Requirements for Messaging and VoIP Calling Apps Messaging SiriKit Messaging Intents CarPlay Messaging Entitlement

Requirements for Messaging and VoIP Calling Apps Messaging SiriKit Messaging Intents CarPlay Messaging Entitlement VoIP Calling SiriKit Calling Intents CarPlay VoIP Calling Entitlement CallKit

Required SiriKit Intents for Messaging Apps

Required SiriKit Intents for Messaging Apps Send a message INSendMessageIntent

Required SiriKit Intents for Messaging Apps Send a message INSendMessageIntent Search for messages INSearchForMessagesIntent

Required SiriKit Intents for Messaging Apps Send a message INSendMessageIntent Search for messages INSearchForMessagesIntent Set attributes on a message INSetMessageAttributeIntent

Required SiriKit Intents for VoIP Calling Apps

Required SiriKit Intents for VoIP Calling Apps Start an audio call INStartAudioCallIntent

Required SiriKit Intents for VoIP Calling Apps Start an audio call INStartAudioCallIntent Search call history INSearchCallHistoryIntent

Required SiriKit Intents for VoIP Calling Apps Start an audio call INStartAudioCallIntent Search call history INSearchCallHistoryIntent What s New in SiriKit Grand Ballroom B Wednesday 1:50PM Making Great SiriKit Experiences Grand Ballroom A Thursday 11:00AM

CallKit

CallKit Report incoming calls

CallKit Report incoming calls Handle call actions Start, answer, end Mute, grouping, holding, keypad tones

CallKit Report incoming calls Handle call actions Start, answer, end Mute, grouping, holding, keypad tones Enhancing VoIP Apps with CallKit WWDC 2016

Notifications

Notifications Request authorization for CarPlay

Notifications Request authorization for CarPlay Separate message notifications into an exclusive notification category

Notifications Request authorization for CarPlay Separate message notifications into an exclusive notification category Add the CarPlay category option

Notifications Request authorization for CarPlay Separate message notifications into an exclusive notification category Add the CarPlay category option Set a SiriKit intent to handle notification selection

let authorizationoptions : UNAuthorizationOptions = [.badge,.sound,.alert,.carplay] let notificationcenter = UNUserNotificationCenter.current() notificationcenter.requestauthorization(options: authorizationoptions) { (granted, error) in // Enable or disable app features based on authorization } let messagecategory = UNNotificationCategory( identifier: "messages", actions: [ ], intentidentifiers: [INSearchForMessagesIntentIdentifier], options:.allowincarplay) notificationcenter.setnotificationcategories([messagecategory])

Best Practices

Best Practices Don t show message contents in a notification s title or subtitle

Best Practices Don t show message contents in a notification s title or subtitle Mark content as read in SiriKit

Best Practices Don t show message contents in a notification s title or subtitle Mark content as read in SiriKit Show notifications for missed calls and message delivery failures

Automaker Apps

Automaker Apps

Requirements for Automaker Apps

Requirements for Automaker Apps Created by the car s manufacturer to provide information and control features

Requirements for Automaker Apps Created by the car s manufacturer to provide information and control features Automaker-specific entitlement

Requirements for Automaker Apps Created by the car s manufacturer to provide information and control features Automaker-specific entitlement Display a user interface in CarPlay

Requirements for Automaker Apps Created by the car s manufacturer to provide information and control features Automaker-specific entitlement Display a user interface in CarPlay Only appear on supported vehicles from the automaker

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement Track Laps com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.radio com.sampleautos.climate com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.radio com.sampleautos.climate com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement Comfort com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.electric com.sampleautos.performance com.sampleautos.climate

Matching Automaker Apps to Vehicles CarPlay Protocols Entitlement com.sampleautos.electric com.sampleautos.performance com.sampleautos.climate

Communicating with the Vehicle

Communicating with the Vehicle Use External Accessory Framework

Communicating with the Vehicle Use External Accessory Framework Define a custom protocol

Communicating with the Vehicle Use External Accessory Framework Define a custom protocol Implement the protocol in the vehicle s software

Communicating with the Vehicle Use External Accessory Framework Define a custom protocol Implement the protocol in the vehicle s software Observe accessory connection events

Communicating with the Vehicle Use External Accessory Framework Define a custom protocol Implement the protocol in the vehicle s software Observe accessory connection events Initialize an EASession for the protocol

Adding a CarPlay User Interface

Adding a CarPlay User Interface Observe UIScreen connection events

Adding a CarPlay User Interface Observe UIScreen connection events Verify the screen s traits contain UIUserInterfaceIdiomCarPlay

Adding a CarPlay User Interface Observe UIScreen connection events Verify the screen s traits contain UIUserInterfaceIdiomCarPlay Create a UIWindow with a root view controller

var carwindow: UIWindow? func updatecarwindow() { guard let screen = UIScreen.screens.first(where: { $0.traitCollection.userInterfaceIdiom ==.carplay }) else { // CarPlay is not connected self.carwindow = nil; return } } // CarPlay is connected let carwindow = UIWindow(frame: screen.bounds) carwindow.screen = screen carwindow.makekeyandvisible() carwindow.rootviewcontroller = CarViewController(nibName: nil, bundle: nil) self.carwindow = carwindow

updatecarwindow() let notificationcenter = NotificationCenter.default notificationcenter.addobserver(self, selector: #selector(screendidupdate(notification:)), name:.uiscreendidconnect, object: nil) notificationcenter.addobserver(self, selector: #selector(screendidupdate(notification:)), name:.uiscreendiddisconnect, object: nil) @objc func screendidupdate(notification: Notification) { updatecarwindow() }

UIKit in CarPlay

UIKit in CarPlay UIButtonTypeSystem displays with a CarPlay style

UIKit in CarPlay UIButtonTypeSystem displays with a CarPlay style UITableViewController may limit table length

UIKit in CarPlay UIButtonTypeSystem displays with a CarPlay style UITableViewController may limit table length UIFocusEnvironment responds to input device events

UIKit in CarPlay UIButtonTypeSystem displays with a CarPlay style UITableViewController may limit table length UIFocusEnvironment responds to input device events Limited availability of system user interface elements

SiriKit for Automaker Apps

SiriKit for Automaker Apps Car Commands Intents Lock and unlock Fuel or charge level Signal tone and lights

SiriKit for Automaker Apps Car Commands Intents Lock and unlock Fuel or charge level Signal tone and lights CarPlay Intents Climate, defroster, and seat heater settings Radio and audio source selection

Best Practices

Best Practices Make your app useful even when outside of the car

Best Practices Make your app useful even when outside of the car Consider forwards and backwards compatibility

Best Practices Make your app useful even when outside of the car Consider forwards and backwards compatibility Simplify the user interface buttons, labels, tables, navigation, tabs

Best Practices Make your app useful even when outside of the car Consider forwards and backwards compatibility Simplify the user interface buttons, labels, tables, navigation, tabs Determine how focus should move between UI elements

More Information https://developer.apple.com/wwdc17/719

Related Sessions Debugging with Xcode 9 Hall 2 Wednesday 10:00AM What s New in SiriKit Grand Ballroom B Wednesday 1:50PM Making Great SiriKit Experiences Grand Ballroom A Thursday 11:00AM Developing Wireless CarPlay Systems WWDC 2017 Video Enhancing VoIP Apps with CallKit WWDC 2016 Developing CarPlay Systems, Part 1 WWDC 2016 Developing CarPlay Systems, Part 2 WWDC 2016

Labs CarPlay Lab Technology Lab D Wednesday 4:10PM 6:00PM SiriKit Lab Technology Lab B Wednesday 3:10PM 5:00PM SiriKit Lab Technology Lab C Friday 9:00AM 12:00PM