SDKOptions
public struct SDKOptions : Hashable
SDKOptions provide an alternative way to set or update the HERE SDK credentials and other
parameters at runtime to initialize the SDKNativeEngine.
-
Optional project ID to set the project scope of the login session. Not used if empty. see also Manage Projects and IAM Concepts
Declaration
Swift
public var scope: String -
Path to be used for caching purposes. It should be a path to the desired location where the application has read/write permissions. The path can be on internal or external storage. By default, this returns an empty string. Setting a new string, will overwrite the internally used default paths:
<Application_Home>/Library/Caches. If an absolute path is set, it will be used instead. If a relative path is set then directory<Application_Home>/Library/Cachesis used as parent path.Declaration
Swift
public var cachePath: String -
Desired upper bound of application size in bytes. When cached data exceeds cache_size, least recently used data will be removed. Default value 256MB
Declaration
Swift
public var cacheSizeInBytes: Int64 -
Path used for storing application internal data, such as the offline search index and other essential data required for proper functionality.
Note: For common use cases, prefer
SDKOptions.persistentMapStoragePath, or keep the default paths. UsedataPathonly as a fallback ifSDKOptions.persistentMapStoragePathis not writable, for example, when you have an agreement with HERE to flash data at factory time.By default, this returns an empty string. In this case, the same path as
SDKOptions.persistentMapStoragePathwill be used. If an absolute path is set, it will be used instead. If a relative path is set then directoryApplication Library directoryis used as parent path. Application must have read/write permissions to the given desired path. It is recommended that the application has exclusive access to this path. Avoid using shared or public directories such asDownloadorDocuments. Using such directories may cause certain HERE SDK features to behave with limitations. For example, index creation for offline search may fail or not function as expected. It is recommended not to use the application cache paths like<Application_Home>/Library/Caches, since operating system manages data in this location and data can be deleted if the device is low on storage space, which will result in application malfunction. The path can be on internal or external storage. The internal storage is recommended due to the file I/O speed. Note: If theSDKOptions.persistentMapStoragePathis writable,dataPathcan be left empty. If theSDKOptions.persistentMapStoragePathis not writable,dataPathmust be set and also be writable. Note thatdataPathis used to store essential HERE SDK data.Important: There is no automatic migration of stored data between the
SDKOptions.persistentMapStoragePathand thedataPath. For ease of management, it’s recommended to set the persistence path as writable and ignoredataPath. IfdataPathis set differently from theSDKOptions.persistentMapStoragePath, some data that would typically be saved in theSDKOptions.persistentMapStoragePathwill now be saved todataPath. IfdataPathis set and later unset, any data stored there will remain inaccessible and will not be migrated back.Declaration
Swift
public var dataPath: String -
Path to store persistent map data. This should be the a path to the desired location for which the application has read/write permissions. The path can be on internal or external storage. By default, this returns an empty string. Setting a new string, will overwrite the internally used default paths:
Application Library directory. If an absolute path is set, it will be used instead. If a relative path is set then directoryApplication Library directoryis used as parent path. Note: Offline maps stored at<persistent_map_storage_path>/v1/<access_key_id>/ocm-map/, where<access_key_id>is taken fromSDKOptions.authenticationMode. WhenSDKOptionsinitialized withAuthenticationMode.withTokenorAuthenticationMode.withExternal, then<access_key_id>left empty.Note: If the persistent map storage location has the read only permission, then the
SDKOptions.dataPathmust be configured.Declaration
Swift
public var persistentMapStoragePath: String -
Geopolitical view of a country, defined as a three letter country code by ISO 3166-1 alpha-3. Each disputed territory has an international and an alternative geopolitical view. When set, the map view will show all country boundaries according to the geopolitical view of the country that has been set.
Note: Defaults to an empty string which enables the international view.
This is a beta feature and thus there can be bugs and unexpected behavior.
Declaration
Swift
public var politicalView: String -
Sets offline mode for the HERE SDK. Defaults to
false. When enabled, this prevents the HERE SDK from initiating any online connection from starting. The mode can be disabled or enabled again at any time viaSDKNativeEngine.isOfflineMode.Declaration
Swift
public var offlineMode: Bool -
Defines a list of data features that can be enabled / disabled. Once set to
SDKOptionswhen a new HERE SDK is constructed, it will affect the map cache and offline maps. When disabling certain features, less data will be prefetched when the map is rendered. Map data that was already cached will not be removed until the least recently used strategy (LRU) applies. That means you cannot remove any content from the map cache by updating theLayerConfiguration. However, for new map data, it will be applied. For offline maps, thisLayerConfigurationcan reduce the download size of all regions. Note that theLayerConfigurationis applied globally to all regions that will be downloaded in the future. It will not affect already downloaded regions. Updating a region will also not update theLayerConfiguration. Only theLayerConfigurationwill be used that was set globally when a region was downloaded for the first time. If you want to update theLayerConfigurationfor an already downloaded region, please delete the region and download it again.Please also note
- The
LayerConfigurationis only applicable for the HERE SDK (Navigate) that contains the offline maps feature. It has no effect on other licenses. - The
LayerConfigurationcannot be set separately for a region, it will be applied globally for all regions that will be downloaded in the future. - It is not possible to specify a separate
LayerConfigurationfor the map cache and offline maps. TheLayerConfigurationwill be always applied to both. - The
LayerConfigurationdoes affect the map cache when a device has connectivity. Even when a device has connectivity it will only download the specified layers. - This is a beta feature and thus there can be bugs and unexpected behavior.
Declaration
Swift
public var layerConfiguration: LayerConfiguration - The
-
This field specifies how the
SDKNativeEngineshould access, use and store data for different catalogs. You can access default catalogs on the HERE platform and also custom catalogs such as for self-hosted or BYOD (bring your own data) use cases. For further information about catalogs and related concepts seeCatalogConfigurationNote: This API is only available for the Navigate license. It has no affect on other license.
Declaration
Swift
public var catalogConfigurations: [CatalogConfiguration] -
Parameter to enable automatic cache updates.
When it is false, the cache will always use the same map version as offline maps. If offline maps are updated, the cache will be also updated. The cache version will never be older than the offline maps version.
When it is true, the cache will be automatically updated to use the latest map data that is available. In that case, the cache may contain map data that is newer than the offline maps data. Note that auto updates may also lead to increased network traffic, as the cached data will be evicted tile-by-tile before it is filled with newer map data. This process continues everytime the user views a new map view area until the data is replaced. Once also the offline map data is updated by the user, both map versions will be the same again.
If the value is also specified via the manifest (Android) or plist (iOS), than the value set via
SDKOptionswill overrule the value that was set in manifest/plist - until the current session ends and the value is read/set again.Note that offline maps are only available for the Navigate license.
Defaults to
false.Note: Do not use this yet, the behavior of this feature may be inconsistent. Once it will be usable, it will be announced in the regular HERE SDK release notes.
Declaration
Swift
public var autoUpdateOfOnlineCache: Bool -
Set custom options for SDK Engines. This includes:
custom_base_url: Allows engines to use custom base URLs for alternative services. By default, the available endpoints use HERE backend endpoints. If unsupported base URLs are specified, the related features will become non-functional. Please contact your HERE representative to learn about possible custom base URL usage options.custom_authentication_mode: Enables bearer authentication mode for engines, which adds or omits the header (“Authorization”, “Bearer $Token”) to each online request made by the module the object is added to. The token (if used) can be provided directly or retrieved via key/secret from a dedicated backend. Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public var customEngineOptions: [EngineBaseURL : EngineOptions] -
Encapsulates Authentication method and parameters.
Declaration
Swift
public var authenticationMode: AuthenticationMode -
Network settings to use at the start. Some of those settings can be changed later.
Declaration
Swift
public var networkSettings: NetworkSettings -
If an application runs in a memory-constrained environment, enable this option to reduce the HERE SDK’s memory footprint. When set to
trueconfigures internal memory caches to consume less memory. Reduction in cache sizes also reduces performance of the HERE SDK. In order to release memory occupied by internal caches seeSDKNativeEngine.purgeMemoryCaches(...).Declaration
Swift
public var lowMemoryMode: Bool -
Internal to HERE SDK. DO NOT USE THIS YET.
Warning: This is a placeholder and under developement. We will announce its availability in our changelog once it is ready for use.
A parameter to set a billing tag to track your HERE platform usage across the various HERE services your application may contact. For more information on the billing tag, see our cost management guide. The tag needs to follow the format as described in the guide or it will be ignored. The parameter defaults to
nil, which also means that the tag is ignored for all requests.Note: The billing tag is optional, but when set, it can help you to understand how often your app uses certain services, for example, the number of hits to our HERE backend routing services. For more details on tracking such details, please consult the cost management guide or get in touch with the HERE billing team.
Declaration
Swift
public var billingTag: String? -
Options that define custom behavior for the HERE SDK. These settings allow fine-tuning of internal thread pools and resource management for advanced use cases. These options are intended for internal usage only and should not be modified unless instructed by HERE support.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public var customOptions: Metadata? -
Constructs a SDKOptions from authentication mode. Other fields are filled with default values.
Declaration
Swift
public init(authenticationMode: AuthenticationMode)Parameters
authenticationModeAuthentication Mode used for obtaining an access token.