Docs / Setup / iOS / HERE

HERE setup

How to drive the HERE SDK through MapConductor. Initialisation takes a pair: an access key ID and a secret.

PACKAGE
ios-for-here
API KEY
Key ID + secret
MIN iOS
16.0
VIEW
HereMapView
Same provider, other platformsAndroidReact

Before you start

Xcode 15 or newer
A HERE Platform account
A HERE SDK access key ID and secret
A deployment target of iOS 16.0 or later
STEP 01

Get the credentials

  1. Open the HERE Platform.
  2. Create a project or select an existing one.
  3. Create an access key for the HERE SDK.
  4. Copy the access key ID and the secret.
STEP 02

Add it with Swift Package Manager

Use File > Add Package Dependencies in Xcode and paste the package URL. The native SDK comes in as a transitive dependency — you do not add it separately.

Package URLSwift Package Manager
https://github.com/MapConductor/ios-for-here
Package.swiftSwift
dependencies: [
    .package(url: "https://github.com/MapConductor/ios-sdk-core", from: "1.1.4"),
    .package(url: "https://github.com/MapConductor/ios-for-here", from: "1.0.0"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "MapConductorCore", package: "ios-sdk-core"),
            .product(name: "MapConductorForHERE", package: "ios-for-here"),
        ]
    ),
]
STEP 03

Initialise the SDK

Call initializeHERE(accessKeyId:accessKeySecret:) exactly once, before any map view is created. It throws — do not swallow the failure.

MyApp.swiftSwift
import SwiftUI
import MapConductorForHERE

@main
struct MyApp: App {
    init() {
        do {
            try initializeHERE(
                accessKeyId: "YOUR_HERE_ACCESS_KEY_ID",
                accessKeySecret: "YOUR_HERE_ACCESS_KEY_SECRET"
            )
        } catch {
            assertionFailure("Failed to initialize HERE SDK: \(error)")
        }
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
ContentView.swiftSwift
// Alternative: call it from the view's sdkInitialize closure
HereMapView(state: mapState, sdkInitialize: {
    try? initializeHERE(
        accessKeyId: "YOUR_HERE_ACCESS_KEY_ID",
        accessKeySecret: "YOUR_HERE_ACCESS_KEY_SECRET"
    )
})
STEP 04

Add the location permission (if needed)

If you use location services with the HERE SDK, declare the purpose in Info.plist.

Info.plistXML
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to display on the map</string>
LocationManager.swiftSwift
import CoreLocation

final class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate {
    private let manager = CLLocationManager()

    override init() {
        super.init()
        manager.delegate = self
    }

    func requestPermission() {
        manager.requestWhenInUseAuthorization()
    }
}

VERIFY

What you should see

You are done when the HERE map renders and zoom and pan work.

ContentView.swiftSwiftUI
import SwiftUI
import MapConductorCore
import MapConductorForHERE

struct ContentView: View {
    @StateObject var mapState = HereMapViewState(
        mapDesignType: HereMapDesign.NormalDay,
        cameraPosition: MapCameraPosition(
            position: GeoPoint(latitude: 35.6812, longitude: 139.7671),
            zoom: 12.0
        )
    )

    var body: some View {
        HereMapView(state: mapState)
            .ignoresSafeArea()
    }
}

Map designs

HereMapDesign maps onto HERE's map schemes.

HereMapDesign
Notes
NormalDay / NormalNight
The standard style, day and night
Satellite
Satellite imagery
HybridDay
Satellite imagery with roads and labels
LiteDay
A lightweight day style
LogisticsDay
Tuned for logistics
RoadNetworkDay
Road-network emphasis

Troubleshooting

The map stays blank

  • Check the access key ID and secret.
  • Confirm initializeHERE runs before the map view is created.
  • Catch the throw from initialisation and log what it says.

The build fails

  • Clean the build folder (Cmd+Shift+K).
  • Delete ~/Library/Developer/Xcode/DerivedData and rebuild.
  • Refresh the Swift Package Manager dependencies, and avoid mixing in CocoaPods.

Next

Markers, polylines, polygons, circles, ground images, raster layers and info bubbles all work through the shared API. HERE has no native support for polygon holes, so MapConductor renders them via generated mask tiles — your call sites stay identical to the other providers.