Add CarPlay support to your navigation app using CarPlay.

Posts under CarPlay tag

138 Posts

Post

Replies

Boosts

Views

Activity

CarPlay map view stops updating when iPhone screen turns off
Hello all, I have a food delivery app that I am beginning to implement CarPlay support in. Route picking, navigation, turn-by-turn guidance features all work perfectly on iPhone, and on CarPlay while the iPhone is unlocked, or locked but screen on. However, when the iPhone is locked and the screen is off, the CarPlay map view stops following the user's location and appears to be frozen. When this happens, the other "map buttons" that are part of the CPMapTemplate continue to accept user input (I can enter and exit the map panning mode for example), the user's location continues to update, and the turn-by-turn guidance continues as normal. It appears to be just the map view (which is drawn on the window and is not part of the CPMapTemplate) that stops updating in this state. I've been through every page of Apple documentation on CarPlay but nothing references or addresses how to keep the CarPlay session active while the iPhone is locked. I'm not sure where else to look for answers and I'm out of theories as to why this might happen. Any guidance around this would be greatly appreciated.
1
0
102
Mar ’25
Application does not implement CarPlay template application lifecycle methods in its scene delegate
Hello, I've been banging my head against this for a couple of days now I can't get the CarPlay interface to work on my music app I see the error: Application does not implement CarPlay template application lifecycle methods in its scene delegate I've checked the sample code and developer guides and can't see my mistake My CarPlay delegate code is: class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate { var interfaceController: CPInterfaceController? var carPlayWindow: UIWindow? private let playerManager = MusicPlayerManager.shared private var playlists: MusicItemCollection<Playlist> = [] // MARK: - CPTemplateApplicationSceneDelegate Methods func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) { // Store reference to the interface controller to use throughout the app self.interfaceController = interfaceController // Request Apple Music authorization if needed requestMusicAuthorization() // Configure the interface with the now playing template and specified tabs setupCarPlayInterface(interfaceController) } func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController) { // Clean up when CarPlay disconnects self.interfaceController = nil print("CarPlay disconnected") } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state print("CarPlay scene became active") } etc My info.plist contains: <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>CPTemplateApplicationSceneSessionRoleApplication</key> <array> <dict> <key>UISceneClassName</key> <string>CPTemplateApplicationScene</string> <key>UISceneConfigurationName</key> <string>TemplateSceneConfiguration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).CarPlaySceneDelegate</string> </dict> </array> </dict> </dict> My one doubt is this entry in the plist: UISceneConfigurationName as I can't find any clarity in the docs how to use or implement this Can anyone suggest where I need to be looking? Thanks for your help!
2
0
210
Mar ’25
App Freezing at Launch and Unexpected Termination
We are experiencing an issue where our app gets stuck during launch. The splash screen appears for some time, and then the app either becomes unresponsive or closes unexpectedly. However, there are no crash logs captured in Xcode or Firebase Crashlytics, indicating that the app is not crashing but rather being terminated. This issue is preventing affected users from properly launching the app. Additionally, some users have reported occasional lag and slow performance when using the app. The issue occurs only for a specific subset of users and appears to be related to other Electronic Logging Device (ELD) apps running in the background. When these apps are active, our app struggles to launch and sometimes becomes unresponsive. We suspect that this behavior could be related to system resource allocation, such as high memory consumption by background apps, which might be affecting our app's ability to launch correctly. However, we have been unable to reproduce the issue on our end despite multiple attempts. Actions Performed During App Launch: Firebase configuration API requests, including: Fetching account details Registering the FCM token with the server Asynchronous background requests to fetch POI details Creating a local database and storing POI data in local storage We would like guidance from Apple regarding potential causes and debugging strategies, especially in scenarios where the app does not produce crash logs but still fails to launch properly. Any insights into memory management, conflicts with background applications, or system resource constraints would be highly appreciated. Steps to Reproduce: Install and launch the app on an affected device. Observe that the app gets stuck on the launch screen. After some time, the app terminates unexpectedly. Issue is inconsistent and occurs only for certain users. Presence of other ELD apps running in the background appears to influence the issue.
3
0
302
Mar ’25
CarPlay shows black screen on my car for first connection if iOS version larger than 17.5
iPhone: iPhone 12 pro max, iOS:18.3.1 Step: Connect CarPlay to my car, after connection success, CarPlay screen is black. This issue only happens of first time connection; I have asked OEM factory, they told me because of my iOS version is larger than 17.5, and above this version, will have this issue. So, I need your help to figure problem and update in new version.
0
0
321
Mar ’25
CarPlay Question
Why is there no option as a CarPlay developer to enable the creation of an App to track and enter your car's maintenance records? I know the pat reply would be Apple doesn't want you to do this while car is in motion. But I would normally do this while parked at the dealership or other service provider no?
1
0
280
Mar ’25
Apply Carplay Issues 18.1 - Phone Calls Not Working Properly
I have a 2020 Toyota Camry XSE. Ever since the iOS 18 and 18.1 updates while connected to my car via the USB cable to CarPlay when receiving or making calls the calls are lagging. A little bit of background is I have the new iPhone 16 Pro, the phone is completely up to date and my car has all the latest updates available as well so everything is up to date. I also bought a new USB cord to make sure it was not a cord issue. When I connect to my car through the cable and go to car play, everything works except for when I make or receive a call. When making or receiving a call upon answering or starting the call the moment the person picks up the system delays both voices on the call. What happens is the "time on phone display" that shows during the call, the time does not move like the call is frozen on the screen. Because of that the call is lagged when I speak or they speak and you are unable to have a normal conversation because of this. If I put the phone on speaker while still connected all of a sudden the call time unfreezes on the screen and starts counting again but the moment it take it off speaker the time freezes again and the call starts lagging again. I have NEVER had an issue until the iOS 18 updates. Please provide any feedback or suggestions, or if this is a known issue and it is currently being worked on. Like I said everything else works except for making/receiving calls that is when the issues start and the CarPlay screen freezes and starts the issues.
16
10
3.1k
Mar ’25
CarPlay music sound output from iPhone after enabled Enhanced Siri
With CarPlay communication plugin R18.1, I followed these steps to integrate Enhance siri, the music sound was output from carplay and there is no option for output to Car. ============================================ Enhanced Siri Declare supported audioFormats for the AuxIn and AuxOut streams Since the AuxIn and AuxOut streams for Siri do not have to be both active at the same time, the accessory must claim audio formats support for AuxIn Audio and AuxOut audio independently. The audio formats for each stream can differ from each other (48KHz for AuxOut and 16KHz for AuxIn). The new audio types represent these new streams - AuxIn/speechRecognition & AuxOut/speechRecognition. Check if connected device supports the feature AirPlayReceiverSessionHasFeatureEnhancedSiri() Claim support in the Setup Response message if device supports the feature Add kAirPlayKeyAccessoryEnabledFeature_EnhancedSiri key through the AirPlayReceiverServer delegate AirPlayReceiverServerCopyProperty_f function for the kAirPlayKey_AccessoryEnabledFeatures key. Helper function: CFArrayAppendValue() Add Enhanced Siri parameters dictionary in the INFO message Add dictionary through the AirPlayReceiverServer delegate AirPlayReceiverServerCopyProperty_f function for the kAirPlayKey_EnhancedSiriInfo key. kAirPlayKey_EnhancedSiriInfo dictionary parameters: Voice activation of Siri - kAirPlayKey_EnhancedSiriVoice Current language of voice model - kAirPlayKey_VoiceModelCurrentLanguage Supported languages of voice model - kAirPlayKey_VoiceModelSupportedLanguages Enhanced Button activation of Siri - kAirPlayKey_EnhancedSiriButton Supported zone(s) if any - kAirPlayKey_SupportedSiriTriggerZones Update AudioStream Get state of the AuxIn state by providing an implementation of AudioStreamUpdateState() - Off, local buffering, or streaming to device. Decouple input streams from output streams. AuxIn is an independent input stream only. The property kAudioStreamProperty_Direction will provide the necessary information if the stream is input, output or input & output. Provide a handler for the AirPlayReceiverSessionDelegate setEnhancedSiriParams_f This will provide additional information: Activation type Setting the language of the voice model Invoke the Communication Plugin to start buffering Once the activation type has been specified, the accessory can request the plugin to start buffering using AirPlayReceiverSessionAuxInStart(). Use the new APIs to trigger Siri: AirPlayReceiverSessionRequestSiriActionWithLatency() AirPlayReceiverSessionRequestSiriVoiceActivationWithLatency() AirPlayReceiverSessionRequestSiriVoiceActivationWithSample() Button presses and voice activations should use this new APIs which adds a timestamp of the activation. These APIs allow a choice of a latency or a sample for button and voice activations. If there is a delay between the user pressing the button to notifying the device on the button press, this latency value should represent this time. If the accessory can determine which zone activated, it can provide the zone with the request. Invoke the Communication Plugin to stop buffering You may need to invoke the plugin to stop buffering (AirPlayReceiverSessionAuxInStop()) if exclusive access to the microphone is necessary. Such instances may include but not limited to: Native voice recognition session Telephony Another stream function which uses the microphone starts modesChanged notification can be used to determine if a resource is being used Note, if the session ends, the plugin will automatically stop buffering
0
0
269
Mar ’25
How to show/hide Now Playing button on CPTabBarTemplate
I'm working on adding CarPlay support to an audio app and I'd like to mimic the behavior of the Apple Music app on launch. Forgive me, but I think using Gherkin syntax here will help to best describe the desired behavior: GIVEN the Apple Music app is in a cold state (not launched or in memory) AND another audio app is actively playing audio WHEN I launch the Apple Music app from CarPlay THEN the Now Playing template is shown via a push AND the appropriate Now Playing info is shown AND the Now Playing button is shown on the tab bar AND the actively playing audio from another audio app is NOT interrupted The current behavior I see in my own app is that I can push on the Now Playing template and fill out the MPNowPlayingInfoCenter's info dictionary, but it won't render the info or show the Now Playing button on the tab bar until I start playing audio. Also, is there a way to hide the Now Playing button after the queue of content has finished playing? I'm able to pop the Now Playing template, but the Now Playing button is still present and tapping it will navigate the user to the now blank Now Playing template.
1
0
344
Mar ’25
PhoneSceneDelegate white screen
I am currently implementing multiple scenes in my React Native / Swift application (one scene for the phone and one scene for CarPlay). I am facing an issue where one scene renders completely white (on the iPhone) but I can see in the console that the code is running (for example if I add a console.log to the App.tsx I can see that console log happen in XCode). There are no errors when building the app in XCode, and testing with the simulator CarPlay appears to render the correct output, but there is no component being rendered on the simulated phone screen (just white). AppDelegate.swift import CarPlay import React import React_RCTAppDelegate import ReactAppDependencyProvider import UIKit @main class AppDelegate: RCTAppDelegate { var rootView: UIView?; static var shared: AppDelegate { return UIApplication.shared.delegate as! AppDelegate } override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { self.moduleName = "appName" self.dependencyProvider = RCTAppDependencyProvider() self.initialProps = [:] self.rootView = self.createRootView( with: RCTBridge( delegate: self, launchOptions: launchOptions ), moduleName: self.moduleName!, initProps: self.initialProps! ); return super.application(application, didFinishLaunchingWithOptions: launchOptions) } override func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { if (connectingSceneSession.role == UISceneSession.Role.carTemplateApplication) { let scene = UISceneConfiguration(name: "CarPlay", sessionRole: connectingSceneSession.role) scene.delegateClass = CarSceneDelegate.self return scene } let scene = UISceneConfiguration(name: "Phone", sessionRole: connectingSceneSession.role) scene.delegateClass = PhoneSceneDelegate.self return scene } override func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {} override func sourceURL(for bridge: RCTBridge) -> URL? { self.bundleURL() } override func bundleURL() -> URL? { #if DEBUG RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") #else Bundle.main.url(forResource: "main", withExtension: "jsbundle") #endif } } PhoneSceneDelegate.swift import Foundation import UIKit import SwiftUI class PhoneSceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow?; func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if session.role != .windowApplication { return } guard let appDelegate = (UIApplication.shared.delegate as? AppDelegate) else { return } guard let windowScene = (scene as? UIWindowScene) else { return } let rootViewController = UIViewController() rootViewController.view = appDelegate.rootView; let window = UIWindow(windowScene: windowScene) window.rootViewController = rootViewController self.window = window window.makeKeyAndVisible() } } App.tsx import React, {useEffect, useState} from 'react'; import type {PropsWithChildren} from 'react'; import {CarPlay, ListTemplate} from 'react-native-carplay'; import { ScrollView, StatusBar, StyleSheet, Text, useColorScheme, View, } from 'react-native'; import { Colors, DebugInstructions, Header, LearnMoreLinks, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; type SectionProps = PropsWithChildren<{ title: string; }>; function Section({children, title}: SectionProps): React.JSX.Element { const isDarkMode = useColorScheme() === 'dark'; return ( <View style={styles.sectionContainer}> <Text style={[ styles.sectionTitle, { color: isDarkMode ? Colors.white : Colors.black, }, ]}> {title} </Text> <Text style={[ styles.sectionDescription, { color: isDarkMode ? Colors.light : Colors.dark, }, ]}> {children} </Text> </View> ); } function App(): any { // React.JSX.Element const isDarkMode = useColorScheme() === 'dark'; const backgroundStyle = { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, }; const [carPlayConnected, setCarPlayConnected] = useState(CarPlay.connected); useEffect(() => { function onConnect() { setCarPlayConnected(true); CarPlay.setRootTemplate(new ListTemplate(/** This renders fine on the CarPlay side */)); } function onDisconnect() { setCarPlayConnected(false); } CarPlay.registerOnConnect(onConnect); CarPlay.registerOnDisconnect(onDisconnect); return () => { CarPlay.unregisterOnConnect(onConnect); CarPlay.unregisterOnDisconnect(onDisconnect); }; }); if (carPlayConnected) { console.log('car play connected'); } else { console.log('car play not connected'); } const safePadding = '5%'; // This doesn't render on the phone? return ( <View style={backgroundStyle}> <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} backgroundColor={backgroundStyle.backgroundColor} /> <ScrollView style={backgroundStyle}> <View style={{paddingRight: safePadding}}> <Header/> </View> <View style={{ backgroundColor: isDarkMode ? Colors.black : Colors.white, paddingHorizontal: safePadding, paddingBottom: safePadding, }}> <Section title="Step One"> Edit <Text style={styles.highlight}>App.tsx</Text> to change this screen and then come back to see your edits. </Section> <Section title="See Your Changes"> <ReloadInstructions /> </Section> <Section title="Debug"> <DebugInstructions /> </Section> <Section title="Learn More"> Read the docs to discover what to do next: </Section> <LearnMoreLinks /> </View> </ScrollView> </View> ); } const styles = StyleSheet.create({ sectionContainer: { marginTop: 32, paddingHorizontal: 24, }, sectionTitle: { fontSize: 24, fontWeight: '600', }, sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', }, highlight: { fontWeight: '700', }, }); export default App; I have been attempting to get this working now for some 20+ hours with no luck with searching for answers elsewhere. I am very new to building apps with React Native and Swift so could do with some support.
0
0
324
Mar ’25
How can I stop CPNavigationSession properly on CarPlay disconnect
Hi there, I'm facing an issue when disconnecting CarPlay that the navigation session seems to be in some weird state where it is not properly finished. So when I reconnect CarPlay the "Metadata in instrument cluster or HUD" does not update anymore until I start another navigation session and stop that one. You can see that the instruction to the left on this screen recording is not updating anymore after a reconnect. https://www.youtube.com/watch?v=sncxyJULjQk I have a modified the CostalRoad sample app to add support for the HUD cluster and to auto start a navigation simulation when CarPlay connects. https://github.com/g4rb4g3/CoastalRoads Can anyone tell me what I have to do when CarPlay disconnect so I can start a new navigation session on reconnect that has a working HUD cluster? Fun fact is that Apple Maps handles this quite nice (https://www.youtube.com/watch?v=OpJEIyGcwdo), it somehow manages to finish the navigation session and brings up the HUD cluster just fine on reconnect. I wonder how I can achieve the same, anyone having an idea on that?
0
0
258
Feb ’25
Carplay
When are you guys going to fix the CarPlay issues with this new update? I use this for work and it’s really an issue. Nothing is working and it takes up entirely too much space.
1
0
356
Feb ’25
CarPlay Driving Task App Start/Stop NAvigation
Hi you all, I wrote an CarPlay Driving Task App that can start Navigation to a well defined target. This works as expected (navigation app is started to the destination), but sometime, for any important reason, my application receives updates about current destination. I should interrupt current navigation to current destination and update to the new destination. I'm not able to interrnupt/update. Have you any idea if this is possible? Thanls in advance!
1
0
318
Feb ’25
CarPlay style API
Is there any way I can get updates when I change CarPlay style settings? I've tried CPSessionConfigurationDelegate.contentStyleChanged and CPTemplateApplicationSceneDelegate.contentStyleDidChange, but they always produce the same result. When I choose: Automatic -> I receive light in case of daylight; Always Dark and Always Show Dark Map toggle on -> dark Always Dark and Always Show Dark Map toggle off -> light. But it seems to be wrong, b/c CarPlay's toolbar is still dark, and I receive light. Is there a way to get a dark style when choosing Always Dark and Always Show Dark Map toggle off? Or at least get updates when the Always Show Dark Map toggle changes?
0
0
295
Feb ’25
Car play mirroring with flexy limitation and what about new Gen. of Carplay that gonna launch end of this year?
right now it looks like the app type must follow the guidelines like Messenger app, Navigate app, and Music app only. What about the Automotive app itself, What is the flexibility of it? We have an app for service cars for one brand (officially)(car users around 1m+). but we looking to merge the experience between outside the car and inside the car. Can we top up some features on the app to share some information that is a part of the car like trip calculation or car info display on the screen? or services time to notice them? And following that question can we know about the exact spot or brief from Apple car play for now and next-gen? Or can we work with your team closely as a partner? to make things happen and develop it to be a flagship product, we can share some data and talk about it with real insight.
0
0
323
Feb ’25
AVSpeechSynthesizer & Bluetooth Issues
Hello, I have a CarPlay Navigation app and utilize the AVSpeechSynthesizer to speak directions to a user. Everything works great on my CarPlay simulator as well as when plugged into my GMC truck. However, I found out yesterday that one of my users with a Ford truck the audio would cut in an out. After much troubleshooting, I was able to replicate this on my own truck when using Bluetooth to connect to CarPlay. My user was also utilizing Bluetooth. Has anyone else experienced this? Is there a fix to the problem? import SwiftUI import AVFoundation class TextToSpeechService: NSObject, ObservableObject, AVSpeechSynthesizerDelegate { private var speechSynthesizer = AVSpeechSynthesizer() static let shared = TextToSpeechService() override init() { super.init() speechSynthesizer.delegate = self } func configureAudioSession() { speechSynthesizer.delegate = self do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .voicePrompt, options: [.mixWithOthers, .allowBluetooth]) } catch { print("Failed to set audio session category: \(error.localizedDescription)") } } func speak(_ text: String) { Task(priority: .high) { let speechUtterance = AVSpeechUtterance(string: text) speechUtterance.voice = AVSpeechSynthesisVoice(language: AVSpeechSynthesisVoice.currentLanguageCode()) try AVAudioSession.sharedInstance().setActive(true, options: .notifyOthersOnDeactivation) speechSynthesizer.speak(speechUtterance) } } func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didFinish utterance: AVSpeechUtterance) { Task { stopSpeech() try AVAudioSession.sharedInstance().setActive(false) } } func stopSpeech() { speechSynthesizer.stopSpeaking(at: .immediate) } }
0
0
427
Feb ’25
Question regarding CarPlay Integration for a Note/Voice Recording App
Hello everyone, I am currently working on an app project aimed at users who want to quickly and easily capture their ideas and notes while on the go. The basic concept is to develop an iOS app where users can store both typed notes and voice recordings – essentially a "brain dump" solution. The core functionality (storing, editing, synchronizing via CloudKit, etc.) will be handled within the iOS app. In addition, I plan to integrate a CarPlay extension that allows the driver to start and stop a recording – ideally through a minimalist interface featuring a large record button and a "Done" button. Since the iPhone is often not within immediate reach in the car, the CarPlay integration should serve as a quick trigger to initiate the recording in the iOS app. My questions are as follows: Has anyone had experience implementing a CarPlay extension for an app that primarily handles notes and voice recordings, rather than falling into the traditional categories like navigation, audio, or communication? Has such a concept ever been approved by Apple, or are there known hurdles and guidelines that must be observed? Are there alternative approaches to implementing CarPlay integration in this context in a compliant and effective manner? I would greatly appreciate any feedback, shared experiences, and tips on best practices. Thank you in advance and best regards!
1
0
463
Feb ’25
Displaying a toast message and a loader(activity indicator) in CarPlay
Hello, Could you please help me with the below, How to display a toast message to the user in CarPlay after a successful operation? How to show a spinner or an activity indicator just before performing some operation? I have referred to the CarPlay pdf design guidelines in which I couldn't find support for the above two. But I could see a loader within a button in one of the default apps in CarPlay simulator. Kindly help me with these queries
1
0
448
Jan ’25
-[CPListItem handler] timeout?
Hi all! Based on documentation: https://developer.apple.com/documentation/carplay/cplistitem/handler If you need to perform asynchronous tasks, dispatch them to a background queue and call the completion closure or completionBlock when they complete. In a normal case, it works perfectly. But, if it takes "too much", for example, 10 seconds (streaming with retries, app business logic), when I call the "completionBlock" inside "handler" doesn't do anything. Exists a timeout in "completionBlock"? Thanks!
2
0
434
Jan ’25
Displaying a toast on successful operation in CarPlay
Hello, Please guide me if there is a way to show a simple toast to a user that the action has been performed. When a user taps on a button, an api returns a status based on which I need to show appropriate message as a toast. Is this possible in CarPlay? If not, why? Please suggest any alternative for this. Awaiting your response Thanks a lot!!
1
0
469
Jan ’25