Add CarPlay support to your navigation app using CarPlay.

Posts under CarPlay tag

160 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Content items not updating when using MediaPlayer API for CarPlay on iOS18
We are using the MediaPlayer API to provide CarPlay support. Starting in iOS 18 we are having issues updating the content list. The initial list of items will populate on a fresh instance but soon there after an error will show up saying we are not entitled to "com.apple.mediaremote.external-artwork-validation". From that point onwards no changes we make to our MPPlayableContentDataSource are reflected in CarPlay. Even after restarting the device. While the MediaPlayer API is marked as deprecated, we are still using it to provide CarPlay support going back to iOS 10. Has anyone else run into this or have suggestions for workarounds?
3
1
691
Oct ’24
Prerequesities for an App to be approved for CarPlay?
We're developing an app for emergency forces for years now. The App is used by thousands of volunteer fire fighters and medical emergency response forces on a daily basis. We want to enable our app to be available in carplay too. The app offers details about an event the emergency staff gets alerted for and also offers routing to the location of the event. Does anybody know the prerequsities to get an app approved for being available and published for CarPlay? Regards Boxson
1
0
385
Sep ’24
CPVoiceControlState repeating image?
I am trying to use CPVoiceControlState and include an animated image, but for the life of me I cannot figure out what sort of image it wants. I have tried animated .gif, .png, a static image, an image sequence and none seem to animate. Here is what I am using with an animated .png: func showLoadingTemplate() { enum VoiceControlStates: String { case loading = "loading" } let spinner = UIImage(named: "spinner") loadingTemplate = CPVoiceControlTemplate(voiceControlStates: [ CPVoiceControlState(identifier: VoiceControlStates.loading.rawValue, titleVariants: [NSLocalizedString("Loading...", comment: "CarPlay: Loading")], image: spinner, repeats: true) ]) loadingTemplate?.activateVoiceControlState(withIdentifier: VoiceControlStates.loading.rawValue) if let loading = loadingTemplate { currentInterfaceController?.presentTemplate(loading, animated: true, completion: { (result: Bool, error: Error?) in }) } } This shows the image but it isn't animating. Can anyone let me know what sort of image needs to be used in order to get it to animate? I have seen animated images working in Waze and Google Maps so if must be possible.
1
0
414
Sep ’24
Using CPVoiceControlTemplate in my CarPlay app to capture voice
I have a CarPlay navigation app and I would like to allow the user to speak an address and have our app search at that location. In the Waze app, it provides a button to tap, then it brings up a CPVoiceControlTemplate and you can give it directions or a location and it will then show you search results including the text you spoke as the title. I assume that app would have the same limitations as I do, so I am wondering how another app might do this? It was suggested that I use an App Intent with suggested phrases and then a Shortcut could perform the action. Is there documentation on this somewhere or am I going in the wrong direction here? Obviously Waze is doing what I am wanting so there must be a way. Can anyone point me in the right direction?
2
1
808
Sep ’24
Seeking Solutions: Distributing iOS Apps with CarPlay Entitlement via Enterprise Profiles
Dear Apple Developer Support Team, We are seeking a solution that would allow us to include the CarPlay entitlement while distributing our app using an enterprise profile. Could you please provide guidance on how we might achieve this? Are there any alternative approaches or considerations that could help us navigate this limitation? Your expertise and advice would be greatly appreciated as we work to ensure our app meets the needs of our users while complying with Apple’s guidelines. Thank you for your time and support.
0
0
617
Sep ’24
CarPlay - is it feasible?
Hi, I have an app that uses GPS, to locate you, then retrieves a unique ID and then shows you: Location Name Unique ID Latitude & Longitude As you move around, this information is updated within the apps UI. The UI is just a card, with no map and the user is unable to change what is displayed, without moving location. I am wanting to integrate with CarPlay, so the users don't need to touch their device while in a moving car. Am I able do the following within the CarPlay Guidelines?, Display the unique ID Update the ID as the car moves Record a distance between two unique ID's (as the car is moving via a "Start" & "Stop" button) When I look at the CarPlay developer documentation, there is no clear guide on what template to use. Navigation or POI. There is also limited guidance on CarPlay development, so any tips/advice is greatly appreciated. Thanks Hayden
0
0
403
Aug ’24
CarPlay Map Displays White Screen
Hello, I'm somewhat new to CarPlay integration and am having an issue. I have ready through Apple's CarPlay Programming Guide, reviewed their code samples and have exhausted my searches online to help find a solution to my problem. I have been unable to get a basic map to display on my CarPlay map utilizing the following: import CarPlay class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate { var interfaceController: CPInterfaceController? var window: CPWindow? func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) { self.interfaceController = interfaceController let mapTemplate = CPMapTemplate() mapTemplate.mapDelegate = self interfaceController.setRootTemplate(mapTemplate, animated: true, completion: { success, error in if let error = error { debugPrint("Error: \(error)") } else { print("CarPlay Map Should Be Displayed") } }) let trip = CPTrip(origin: MKMapItem(placemark: .init(coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))), destination: MKMapItem(placemark: .init(coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))), routeChoices: []) mapTemplate.startNavigationSession(for: trip) } } extension CarPlaySceneDelegate: CPMapTemplateDelegate { func mapTemplate(_ mapTemplate: CPMapTemplate, panWith direction: CPMapTemplate.PanDirection) { // Handle panning } func mapTemplate(_ mapTemplate: CPMapTemplate, startedTrip trip: CPTrip, using routeChoice: CPRouteChoice) { // Handle trip start } } I have my CarPlay Entitlements setup, I have my CarPlay Navigation App set in my signing and capabilities and my app icon displays properly on CarPlay (both in simulator and inside of my vehicle). However, as mentioned I only get a white screen. Now, if I utilize the following code, I will get my map to display, however I lose functionality such as panning the map. I'm sure that I am missing something simple on the above example and appreciate any guidance that you may have. func createMapTemplate(destination: TripDetails?, destinationBL: BucketListItems?, route: MKRoute, window: UIWindow) -> CPMapTemplate { mapTemplate = CPMapTemplate() mapTemplate.mapDelegate = self trip = nil let startLocation = CLLocation(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude) let startMapItem = MKMapItem(placemark: MKPlacemark(coordinate: startLocation.coordinate)) startMapItem.name = "Starting Location" let endMapItem = MKMapItem(placemark: MKPlacemark(coordinate: route.polyline.points()[route.polyline.pointCount - 1].coordinate)) endMapItem.name = destination?.campgroundName != nil ? destination!.campgroundName : destinationBL!.name // Create the hosting controller for the SwiftUI view let mapViewController = UIHostingController(rootView: CarPlayMapView(templateManager: self)) window.rootViewController = mapViewController window.makeKeyAndVisible() let routeChoice = createCPRouteChoice(from: route) trip = CPTrip(origin: startMapItem, destination: endMapItem, routeChoices: [routeChoice]) mapTemplate(mapTemplate, selectedPreviewFor: trip!, using: routeChoice) mapTemplate.showTripPreviews([trip!], textConfiguration: nil) return mapTemplate }
1
0
779
Aug ’24
CarPlay / Siri: single message display
We have an app with carplay-messaging capability, and have successfully integrated our app in order to read out the list of unread messages. However, if a single message arrives and our push notification appears, we are not able to have the Siri UI automatically read only that single message or announce it. The 'list' UI appears (siri: "would you like to read your messages...") when tapping the notification, whereas we would like the 'item' UI to appear immediately with the "reply, repeat, don't reply" buttons. Our intent handler service looks like this - basically the auto-generated one for a new Intent Handler Extension: import Intents // As an example, this class is set up to handle Message intents. // You will want to replace this or add other intents as appropriate. // The intents you wish to handle must be declared in the extension's Info.plist. // You can test your example integration by saying things to Siri like: // "Send a message using <myApp>" // "<myApp> John saying hello" // "Search for messages in <myApp>" class IntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessagesIntentHandling, INSetMessageAttributeIntentHandling { override func handler(for intent: INIntent) -> Any { // This is the default implementation. If you want different objects to handle different intents, // you can override this and return the handler you want for that particular intent. return self } // MARK: - INSendMessageIntentHandling // Implement resolution methods to provide additional information about your intent (optional). func resolveRecipients(for intent: INSendMessageIntent, with completion: @escaping ([INSendMessageRecipientResolutionResult]) -> Void) { if let recipients = intent.recipients { // If no recipients were provided we'll need to prompt for a value. if recipients.count == 0 { completion([INSendMessageRecipientResolutionResult.needsValue()]) return } var resolutionResults = [INSendMessageRecipientResolutionResult]() for recipient in recipients { let matchingContacts = [recipient] // Implement your contact matching logic here to create an array of matching contacts switch matchingContacts.count { case 2 ... Int.max: // We need Siri's help to ask user to pick one from the matches. resolutionResults += [INSendMessageRecipientResolutionResult.disambiguation(with: matchingContacts)] case 1: // We have exactly one matching contact resolutionResults += [INSendMessageRecipientResolutionResult.success(with: recipient)] case 0: // We have no contacts matching the description provided resolutionResults += [INSendMessageRecipientResolutionResult.unsupported()] default: break } } completion(resolutionResults) } else { completion([INSendMessageRecipientResolutionResult.needsValue()]) } } func resolveContent(for intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Void) { if let text = intent.content, !text.isEmpty { completion(INStringResolutionResult.success(with: text)) } else { completion(INStringResolutionResult.needsValue()) } } // Once resolution is completed, perform validation on the intent and provide confirmation (optional). func confirm(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) { // Verify user is authenticated and your app is ready to send a message. let userActivity = NSUserActivity(activityType: NSStringFromClass(INSendMessageIntent.self)) let response = INSendMessageIntentResponse(code: .ready, userActivity: userActivity) completion(response) } // Handle the completed intent (required). func handle(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) { // Implement your application logic to send a message here. let userActivity = NSUserActivity(activityType: NSStringFromClass(INSendMessageIntent.self)) let response = INSendMessageIntentResponse(code: .success, userActivity: userActivity) completion(response) } // Implement handlers for each intent you wish to handle. As an example for messages, you may wish to also handle searchForMessages and setMessageAttributes. // MARK: - INSearchForMessagesIntentHandling func handle(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void) { // Implement your application logic to find a message that matches the information in the intent. let userActivity = NSUserActivity(activityType: NSStringFromClass(INSearchForMessagesIntent.self)) let response = INSearchForMessagesIntentResponse(code: .success, userActivity: userActivity) // Initialize with found message's attributes response.messages = [INMessage( identifier: "identifier", conversationIdentifier: "convo1", content: "I am so excited about SiriKit!", dateSent: Date(), sender: INPerson(personHandle: INPersonHandle(value: "sarah@example.com", type: .emailAddress), nameComponents: nil, displayName: "Sarah", image: nil, contactIdentifier: nil, customIdentifier: nil), recipients: [INPerson(personHandle: INPersonHandle(value: "+1-415-555-5555", type: .phoneNumber), nameComponents: nil, displayName: "John", image: nil, contactIdentifier: nil, customIdentifier: nil)], messageType: .text )] completion(response) } // MARK: - INSetMessageAttributeIntentHandling func handle(intent: INSetMessageAttributeIntent, completion: @escaping (INSetMessageAttributeIntentResponse) -> Void) { // Implement your application logic to set the message attribute here. let userActivity = NSUserActivity(activityType: NSStringFromClass(INSetMessageAttributeIntent.self)) let response = INSetMessageAttributeIntentResponse(code: .success, userActivity: userActivity) completion(response) } } Is there specific configuration required to allow display of a single message via tapping on the notification?
3
0
622
Sep ’24
CarPlay fix
I have had the sage issue with ever beta since ios16. Resetting my cars infotainment system seems to fix it. Unsure about other cars, but if I reset my Mazda system by holding the music button, nav, and volume button (mute), for 15-20 seconds, it works again after the recor reboot
0
0
291
Aug ’24
CarPlay navigation app - route planning only on iOS device
We are currently looking into enabling CarPlay for a navigation app. The navigation app allows complex trip planning (not focussed on A-B planning like Apple Maps). As we found the guidelines somewhat loose in this area, we are wondering, if it is allowed to have a navigation app that only offers the navigation feature, so no planning? Any route planning actions needs to be done on the iOS device. So, if you haven't planned/loaded a route, you would only see your location on a map and can drive freely, but without guidance. The Car App programming guideline mentions the select destination as explicit flow of a navigation app. Which makes us think that it might be required to support that flow.
Topic: Design SubTopic: General Tags:
1
0
555
Jul ’24
wireless carplay - wifi SSID's without names
My Iphone is connected to the car via wireless carplay. Technically, the onboarding works via bluetooth, then via the car's hotspot (SSID from the car). I have noticed that an SSID appears under the "known networks" that has no name. The SSID can no longer be deleted, not even with a network reset on the Iphone. I asked my car dealer if he could reproduce the problem with his Iphone and another car. And he can! So it's not my device, it's an Apple problem. To be precise: The fact that you can no longer delete the SSID is Apple's problem, why the car stores an SSID without a name on the Iphone when connecting is possibly the problem of the car manufacturer. Here are a few more screens on this case.
2
0
826
Oct ’24
Request of CarPlay Navigation Entitlement when having the Driving Task one
I have the CarPlay Entitlement "Driving Task" and two of my apps use it. Now, in both apps, I have implemented Navigation. I requested the Navigation CarPlay Entitlement when the feature was mature and builds were available in Test Flight, since I wanted to release the new versions of the apps with navigation available both on the iPhone and in CarPlay. I got no answer to my request, so I decided to release the apps with only navigation in the iPhone and the Driving Task functionality in CarPlay, thinking that maybe being live with navigation in the App Store was a requirement. I have asked permission again, and so far, the request is being ignored again. What are the requirements to get the Navigation CarPlay Entitlement? If the app is approved for navigation, is there something else the app must do to get the entitlement? Requirements for CarPlay Entitlements seem quite obscure, are they listed anywhere? Is there a technical problem to move from an existing CarPlay Entitlement to another? Can that be the reason the entitlement has not been granted? Some of my competitors have the CarPlay Navigation entitlement. My use case is the same (in a better app in my opinion, of course). But I am only getting bad reviews because "the app does not include the map in CarPlay" after the big investment in implementing navigation in the apps. Any help or insight would be appreciated.
2
0
764
May ’25
Apple Classical in CarPlay?
[posted January 30, 2024] Earlier this month, Apple Classical appeared as an app in CarPlay. Hallelujah!!! Three days later it disappeared after another update, apparently because all it did when activated via CarPlay was crash. OK, it was an oopsie (I get it. I spent 30 years in IT, and, well, it happens. They’re called “undocumented features”). Thing is: Apple hasn’t breathed a word about this event at all. Nothing. Nada. Zip. Zippo. Zilch. There’s a huge pent-up audience for this app in CarPlay. Is it coming? Please? Oh please oh please oh please?
1
0
1k
Nov ’24
Touchscreen gestures in CarPlay aren't recognized in the app
Touchscreen gestures in CarPlay aren't recognized in the app (delegate CPMapTemplateDelegate functions aren't called). Tried also in the Coastal Roads demo app to add test functions to check that pan functions are called - the same: func mapTemplateDidBeginPanGesture(_ mapTemplate: CPMapTemplate) { MemoryLogger.shared.appendEvent("Did begin pan gesture.") } func mapTemplate(_ mapTemplate: CPMapTemplate, panBeganWith direction: CPMapTemplate.PanDirection) { MemoryLogger.shared.appendEvent("Did begin pan gesture with direction \(direction.rawValue).") } Note: buttons (on carplay app) are working when pressing on them. Also, the desktop of carplay can be panned (by swipe gesture). Using Xcode 14.3, MacBook pro M1
2
0
638
Dec ’24