Even without an active data connection, the applications developed with the HERE iOS SDK are able to request routing information to assist travelling from one location to another.
Your application's users do not need to maintain active, data connections to calculate routes and render them on a map. It is possible to pre-download updated maps and database information for initiating routing requests while offline. For example, if a user has downloaded offline maps of California and Oregon, a route from San Diego to Portland can be created without any data connection.
For more information about downloading offline maps, refer to Offline Maps (Map Loader).
Force Online or Offline
connectivityproperty on an
connectivityproperty can be set to three possible values:
NMACoreRouterConnectivityDefault- Uses the connectivity as determined through the SDK
NMACoreRouterConnectivityOffline- Uses cached data on the device
NMACoreRouterConnectivityOnline- Attempts to perform online requests, but does not fallback to use cached data even if no connection is available
To ensure that the connectivity mode is applied, set the
connectivity property before launching an
NMACoreRouter calculation request. If an
NMACoreRouterConnectivityOnline route calculation request fails due to connection issues, the HERE SDK returns the
NMARoutingErrorNetworkCommunication error code. If an
NMACoreRouterConnectivityOffline route calculation request fails due to not enough cached data, the HERE SDK returns the
NMARoutingErrorGraphDisconnected error code.