Post

Replies

Boosts

Views

Activity

Archiving a Swift SDK with SPM Dependencies for XCFramework Distribution
Hello, I’m building a Swift-based SDK (using SwiftUI) that will be distributed as a single .xcframework, and consumed by a React Native application. The SDK has multiple internal module dependencies (e.g., Essentials, CoreModels, CoreRepository), each of which is currently implemented as a local Swift Package (SPM). When I attempt to archive the main SDK framework using xcodebuild archive with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, the archive process fails during SwiftEmitModule for these SPMs. I understand this likely relates to module stability requirements for .xcframework distribution. My key question: Is it mandatory to convert all Swift Packages (SPMs) into Xcode framework targets in order to successfully archive and bundle them into a distributable .xcframework? Or alternatively, is there a recommended approach to make Swift Packages archive-compatible for use in a compiled, closed-source SDK, without converting them into Xcode framework targets? Awaiting your guidance.
0
0
62
Jun ’25
Privacy - Siri Usage Description being reset to default text "Describe why your app needs Siri access" on generating archive
I have an iOS app and that has CarPlay enabled. I have Siri capability and the feature has been tested in Car. The voice commands are working perfectly fine. However, I am facing a weird issue as described below, The key NSSiriUsageDescription, is set to custom text in info.plist. After generating archive, I exported and checked the package contents, in which the the key NSSiriUsageDescription was reset to default text(Describe why your app needs Siri access) in the info.plist. I do not have any dynamic build process that's writing to the info.plist. Only the Siri key is being reset, rest of keys like camera/location permissions are intact. Kindly suggest what needs to be done at my end
0
0
42
May ’25
How to highlight the specific POI in the map on scroll
Hello, I have used CPPointOfInterestTemplate for displaying data and as user scrolls using the up/down arrow, I do not see any change in the map. Is there a way to highlight the POIs as the user scrolls through the list? I need to use the map controls and zoom to check the markers on the map. Is it possible to set the zoom level of the map in CarPlay? Pls suggest on the above queries
1
0
65
Apr ’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
420
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
438
Jan ’25
Does EV Charging entitlement support CPSearchTemplate?
I am developing a CarPlay app, that has been approved for EV Charging entitlement. Could you please confirm if the given entitlement supports CPSearchTemplate template as there is some confusion here. I tried using the template by referring to the below link, https://developer.apple.com/documentation/carplay/cpsearchtemplate Here is the snippet, class SearchCPView: UIResponder, CPSearchTemplateDelegate { var searchTemplate: CPSearchTemplate = CPSearchTemplate() override init() { super.init() searchTemplate.delegate = self } func getSearchTemplate(interfaceController: CPInterfaceController?) -> CPGridTemplate { let searchGridButton = CPGridButton(titleVariants: [CarplayButtonTitles.search], image: UIImage(named: ImagesConstants.CarPlay.searchGrid) ?? UIImage(), handler: {[self] _ in guard let controller = interfaceController else { return } controller.pushTemplate(self.searchTemplate, animated: true) { status, error in print(status) } }) let gridTemplate = CPGridTemplate(title: "", gridButtons: [searchGridButton]) return gridTemplate } func searchTemplate(_ searchTemplate: CPSearchTemplate, selectedResult item: CPListItem) async { print(item) } func searchTemplate(_ searchTemplate: CPSearchTemplate, updatedSearchText searchText: String) async -> [CPListItem] { print(searchText) return [CPListItem(text: "", detailText: "")] } } On push, I am getting an exception, *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported object <CPSearchTemplate: 0x30056df00> <identifier: 28, userInfo: (null), tabTitle: (null), tabImage: (null), showsTabBadge: 0> passed to pushTemplate:animated:completion:. Allowed classes: {( CPTabBarTemplate, CPActionSheetTemplate, CPAlertTemplate, CPGridTemplate, CPPointOfInterestTemplate, CPInformationTemplate, CPContactTemplate, CPListTemplate )}'
1
0
313
Jan ’25
How to test iPhone app and CarPlay together?
I have developed a mobile app using SwiftUI. Now I am in the process of building a CarPlay application. I know how to test the CarPlay app using a simulator but here is my confusion, Testing the iPhone app and CarPlay together (few scenarios like user login / logout, location enabled /disabled in the mobile app) Kindly help me validate the above scenarios as I am getting black screen on iPhone whenever the CarPlay is launched. Below is the code snippet, func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { if connectingSceneSession.role == .carTemplateApplication { let sceneConfiguration = UISceneConfiguration(name: "CarPlay Scene", sessionRole: connectingSceneSession.role) sceneConfiguration.delegateClass = CarPlaySceneDelegate.self return sceneConfiguration } // Configuration for other types of scenes return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } struct MyApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() .preferredColorScheme(.light) } } } Info.plist <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>CPTemplateApplicationSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>CarPlay Scene</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).CarPlaySceneDelegate</string> </dict> </array> </dict> </dict>
1
0
376
Jan ’25
How to test iPhone app and CarPlay together?
I have developed a mobile app using SwiftUI. Now I am in the process of building a CarPlay application. I know how to test the CarPlay app using a simulator but here is my confusion, How to test the iPhone app and CarPlay together? I want to test few scenarios like, user login / logout from mobile app. Location enabled /disabled in the mobile app. I know that swiftUI handles the scenes by itself. Kindly help me validate the above scenarios as I am getting black screen on iPhone whenever the CarPlay is launched. Below is the code snippet, func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { if connectingSceneSession.role == .carTemplateApplication { let sceneConfiguration = UISceneConfiguration(name: "CarPlay Scene", sessionRole: connectingSceneSession.role) sceneConfiguration.delegateClass = CarPlaySceneDelegate.self return sceneConfiguration } // Configuration for other types of scenes return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } struct MyApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() .preferredColorScheme(.light) } } } Info.plist <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>CPTemplateApplicationSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>CarPlay Scene</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).CarPlaySceneDelegate</string> </dict> </array> </dict> </dict>
2
0
570
Jan ’25
Need clarification on using Apple MapKit in CarPlay
I have developed a mobile app using SwiftUI that supports GoogleMaps. Now I am in the process of building a CarPlay application. I assume CarPlay only supports Apple MapKit, as I could not find any way to integrate the Google Maps. Below are few queries, Could you please guide me on how I can obtain the user's current location on the CarPlay app launch? Is there a way CarPlay can get the details from the mobile app(not pretty sure as its using Google Maps)? If the user is logged out from the mobile app, what is the flow in CarPlay? Do we have any standard login page asking user to login to the mobile app first? Is there any UI asking the user to capture the location in CarPlay? This is my first CarPlay app. Kindly guide me to a document or so that covers these details. Thanks a ton!!
1
0
432
Dec ’24
Screen refresh issue in CarPlay
I am new to CarPlay development. I am working on an app that has four tabs. The first tab has a POI template. I make an API call, once the data is received, I need to refresh the POI template to display the data received. Below is a sample code. Please guide me on this. Right now I am pushing a new template once data is obtained which is not the right behaviour func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) { self.interfaceController = interfaceController let tabs = CPTabBarTemplate(templates: [firstTab(), secondTab(), thirdTab(), fourthTab()]) interfaceController.setRootTemplate(tabs, animated: true, completion: nil) } func firstTab() -> CPTemplate { // Placeholder template while data is loading let placeholderPOI = CPPointOfInterest(location: MKMapItem(placemark: MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))), title: "Loading...", subtitle: "", summary: "Data is currently loading", detailTitle: "", detailSubtitle: "", detailSummary: "", pinImage: nil) let placeholderTemplate = CPPointOfInterestTemplate(title: "EV Stations", pointsOfInterest: [placeholderPOI], selectedIndex: 0) // Asynchronously update the template once data is loaded Task { await loadAndUpdateTimeConsumingData(for: placeholderTemplate) } return placeholderTemplate } func loadAndUpdateTimeConsumingData(for template: CPPointOfInterestTemplate) async { do { // Simulate a 1-minute delay try await Task.sleep(nanoseconds: 60 * 1_000_000_000) // Mock data let stations = [Station1(name: "Station 1", city: "City A", address: "123 Lane", coordinates: (latitude: 12.3456, longitude: 76.7890))] let pointsOfInterest = stations.map { station -> CPPointOfInterest in let mapItem = MKMapItem(placemark: MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: station.coordinates.latitude, longitude: station.coordinates.longitude))) return CPPointOfInterest(location: mapItem, title: station.name, subtitle: station.city, summary: station.address, detailTitle: "", detailSubtitle: "", detailSummary: "", pinImage: nil) } // Update the template let poiTemplate = CPPointOfInterestTemplate(title: "EV Stations", pointsOfInterest: pointsOfInterest, selectedIndex: 0) await MainActor.run { self.interfaceController?.pushTemplate(poiTemplate, animated: true, completion: nil) } } catch { } }
1
0
476
Dec ’24
Getting an error on launching Carplay App - *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Application does not implement CarPlay template application lifecycle methods in its scene delegate.'
I have a SwiftUI app, and Apple has approved the Carplay entitlement. The entitlement integration is done successfully, however when I try to launch the carplay app I get the below error *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Application does not implement CarPlay template application lifecycle methods in its scene delegate.' Info.plist: UIApplicationSceneManifest UIApplicationSupportsMultipleScenes UISceneConfigurations CPTemplateApplicationSceneSessionRoleApplication UISceneConfigurationName Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).CarPlaySceneDelegate In AppDelegate I have the below func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { if connectingSceneSession.role == .carTemplateApplication { let sceneConfiguration = UISceneConfiguration(name: "CarPlay Scene", sessionRole: connectingSceneSession.role) sceneConfiguration.delegateClass = CarPlaySceneDelegate.self return sceneConfiguration } // Configuration for other types of scenes return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } Why am I getting the exception? Kindly suggest
1
0
645
Oct ’24
Is it possible to display three lines within a row of a list view
Following is a row item within a section of CPListTemplate, CPListItem(text: "Station 1", detailText: "Details\nforStation 1") In the above, is it possible to display data in three lines? I have seen couple of CarPlay apps that do it within a list. However, I am not sure how this can be done. Kindly suggest some ideas Currently I have the below, I want to achieve the below, three lines with a row
Topic: Design SubTopic: General Tags:
1
0
352
Sep ’24
SwiftUI navigation issues in List
I have a list of items/cells where each item has many elements within it including a button. On tap of a cell, it navigates to screen say ViewA. And on tap of button within the cell, it goes to ViewB. However, on tap of the cell, instead of navigating to ViewA, it randomly navigates to ViewB even though the nav link isActive is disabled. Please suggest! ViewA - List view `List { ForEach(testData, id: \.self) { index in ZStack { NavigationLink("", destination:ViewA()).opacity(0) ViewAListItem() }.listRowBackground(Color.clear) .listRowSeparator(.hidden) .background(.clear) } }` In another file, struct ViewAListItem: View { @State var test: Bool = false /// some other code /// /// /// Button(action: { test = true }) { Text("Testing") }.background( NavigationLink("", destination: ViewB(), isActive: $test).opacity(0) ) } Here even though the button is not tapped, variable test is true and navigating to ViewB on tap of cell which should launch ViewAListItem instead. Any issue with this?
0
0
373
Feb ’24