HereMobilitySDK

HereMobilitySDK is the client wrapper for accessing the HereSDKManager API.

new HereMobilitySDK()
Static Members
setUser(user)
getUser(callback)
getLoggingId()

HereMobilitySDKDemand

HereMobilitySDKDemand is the client wrapper for accessing the Demand API, used for requesting, booking and managing rides. HERE Mobility offers a mobility platform solution for transportation service providers, businesses, and consumers. The platform consists of the HERE Mobility Marketplace and API/SDK packages. The HERE Mobility Marketplace is a "broker" between transportation suppliers and consumers, which matches up ride requests with ride offers. The HERE Mobility SDK enables developers to create apps with a variety of mobility features, while connecting to the HERE Mobility Marketplace.

new HereMobilitySDKDemand()
Static Members
getRideOffers(request, callback)
createRide(rideOfferId, passengerDetails, ridePreferences, callback)
getRide(rideId, callback)
cancelRide(rideId, reason, callback)
getRides(rideQuery, callback)
registerForRidesUpdates(rideStatusChanged, rideLocationChanged, error)
unregisterFromRidesUpdates()

LatLng

Represents a location on the planet, defined as a (latitude, longitude) pair.

LatLng
Properties
lat (number) : The latitude; between -90 and 90 degrees, inclusive.
lng (number) : The longitude; between -180 (inclusive) and 180 (exclusive) degrees.

Address

A generic address type. Note that due to the many different address standards, and different uses of this class, all of its fields are optionals.

Address
Properties
countryName (string) : Optional, the country name.
countryCode (string) : Optional, the ISO 3166 Alpha 3 country code.
stateName (string) : Optional, the state name (if relevant).
cityName (string) : Optional, the city name.
districtName (string) : Optional, the district name (if relevant).
streetName (string) : Optional, the street name.
houseNumber (string) : Optional, the house number.
postalCode (string) : Optional, the postal code.
county (string) : Optional, the county (second subdivision level below the country).
subDistrict (string) : Optional, the sub-district (subdivision level below the district; e.g. commonly used in IND).
building (string) : Optional, the building name (e.g. commonly used in HKG).
addressLines (Array<String>) : Optional, the formatted address lines, as they would have been written on an envelope. This field is optional, and may contain empty list.

Waypoint

Waypoint Type, that encapsulates a LatLng type, and additional information.

Waypoint
Properties
location (LatLng) : Location of the waypoint.
address (Address) : Optional, address of the waypoint, null if no address exists.
description (string) : Optional, sets the free text description of the waypoint.

RideWaypoints

The route of the ride, composed of the pickup location and the destination.

RideWaypoints
Properties
pickup (Waypoint) : Pickup waypoint.
destination (Waypoint) : Destination waypoint.

PriceRange

Range of the price.

PriceRange
Properties
lowerBound (number) : Minimum amount.
upperBound (number) : Maximum amount.
currencyCode (string) : Currency code.

TransitOptions

Options relevant to public transport offers.

TransitOptions
Properties
maxAllowedTransfers (number) : Optional, maximum number of allowed transportation method changes. Allowed values are between 0-6, or null . If null is given, there will be no limit on the number of transfers.
maxWalkingDistance (number) : Optional, maximum walking distance in the offer. The measurement unit is meters. valid values are between 0-6000 meters. The default value is 2000 meters.
locale (string) : Optional, the locale to use for the PublicTransportRideOffer . Complies with the ISO 639-1 standard. The default is "EN".

BookingConstraints

Constraints that the supplier must fulfill for the current booking.

BookingConstraints
Properties
passengerCount (number) : Number of passengers on the ride.
suitcaseCount (number) : Number of suitcases on the ride.

RideOfferRequestSortType

RideOfferRequestSortType
Properties
BY_PRICE (string) : Sort offers by price (lowest price first)
BY_ETA (string) : Sort offers by ETA to the pickup point (shortest ETA first)

RideOffersRequest

Request from the SDK to the server for ride offers.

RideOffersRequest
Properties
rideWaypoints (RideWaypoints) : The requested route.
constraints (BookingConstraints) : Optional, conditions that the supplier must accommodate, such as number of passengers, wheelchair access, etc.
prebookPickupTime (number) : Optional pre-booked pickup time, if the ride is requested for more than 30 minutes in the future. The time is given in milliseconds since Epoch.
priceRange (PriceRange) : Optional price range acceptable to the passenger.
sortType (RideOfferRequestSortType) : Optional sort type. If not given, the order is by price, and then by ETA.
passengerNote (String) : Optional note from the passenger.
transitOptions (TransitOptions) : Optional Transit options. This will affect the public transport offers. *

TransitType

The type of the offer.

TransitType

Type: ("TAXI" | "PUBLIC_TRANSPORT")

Properties
TAXI (string)
PUBLIC_TRANSPORT (string)

Price

Price object with the amount to pay and the currency.

Price
Properties
amount (number) : The amount to pay.
currencyCode (string) : The ISO 4217 currency code of the price.

PriceEstimate

Estimation of the price, produced either by the HERE Marketplace or by a ride supplier. The estimate can be either a single fixed price or a price range. The recommended way to use this class is as follows:

PriceEstimate
Properties
fixedPrice (Price) : The fixed price, if exists. The fixed price. Null if the estimation is a range.
priceRange (PriceRange) : The price range, if exists. The price range. Null if the estimation is a fixed price.
Example
const { fixedPrice, priceRange } = estimatedPrice;
if (fixedPrice) {
  const { amount, currencyCode } = fixedPrice;
  console.log('price: ' + amount + " " + currencyCode);
} else {
  const { lowerBound, upperBound, currencyCode } = priceRange;
  console.log('price: ' + lowerBound + "-" + upperBound + " " + currencyCode);
}

CancellationPolicy

CancellationPolicy

Type: ("UNKNOWN" | "ALLOWED" | "NOT_ALLOWED")

Properties
UNKNOWN (string) : Unknown cancellation policy.
ALLOWED (string) : Cancellation by the client is allowed.
NOT_ALLOWED (string) : Cancellation by the client is not allowed.

Supplier

Supplier details.

Supplier
Properties
englishName (string) : The English spelling of the supplier.
localName (string) : Optional, the name of the supplier in the local language.
logoUrl (string) : Optional, the logo URL of the supplier (if exists).
phoneNumber (string) : Supplier phone number.
address (string) : Supplier address.

HereMobilityDemandError

HereMobilityDemandError

HereMobilityDemandError

Type: {reason: string}

Properties
reason (string)

RidePreferences

Preferences of a ride.

RidePreferences
Properties
subscribeToMessages (boolean) : Specifies if messages about the ride will be sent to the passenger. Default is false.

DriverDetails

Details of a driver.

DriverDetails
Properties
name (string) : The full name of the driver.
phoneNumber (string) : The phone number of the driver.
photoUrl (string) : ? URL pointing to photo of the driver, if one exists. null if it doesn't exist.
drivingLicenseId (string) : ? The driver's driving license number, if available.

VehicleType

VehicleType

Type: ("NOT_SUPPLIED" | "STANDARD" | "LIMO" | "VAN" | "OTHER")

Properties
NOT_SUPPLIED (string) : The supplier did not specify the vehicle type.
STANDARD (string) : Standard vehicle.
LIMO (string) : Limousine.
VAN (string) : Van.
OTHER (string) : Other type of vehicle.

Vehicle

Vehicle details.

Vehicle
Properties
licensePlateNumber (string) : License plate number.
vehicleType (VehicleType) : The type of the vehicle.
manufacturer (string) : The manufacturer of the vehicle.
model (string) : The vehicle model.

RideStatus

The ride status.

RideStatus

Type: ("PROCESSING" | "REJECTED" | "ACCEPTED" | "DRIVER_ASSIGNED" | "DRIVER_EN_ROUTE" | "AT_PICKUP" | "PASSENGER_ON_BOARD" | "AT_DROP_OFF" | "COMPLETED" | "CANCELLED" | "UNRECOGNIZED")

Properties
PROCESSING (string) : The request is being "processed" looking for a supplier.
REJECTED (string) : None of the suppliers accepted the offer. No driver was assigned.
ACCEPTED (string) : A supplier accepted the "ride" no driver was assigned yet.
DRIVER_ASSIGNED (string) : A driver was assigned to the ride.
DRIVER_EN_ROUTE (string) : The vehicle is on the way to the pickup point.
AT_PICKUP (string) : The vehicle is waiting at the pickup point.
PASSENGER_ON_BOARD (string) : The vehicle is on the way to the drop-off point.
AT_DROP_OFF (string) : The vehicle arrived at the drop-off point.
COMPLETED (string) : The ride was completed.
CANCELLED (string) : The ride was cancelled (either by the driver or by the passenger)
UNRECOGNIZED (string) : Unrecognized status of the ride

RideStatusLog

A ride's status log. Contains the current status, and a chronological list of previous statuses (ordered by timestamp in descending order).

RideStatusLog
Properties
lastUpdateTime (number) : Timestamp of the last update, in milliseconds since Epoch.
createTime (number) : The time the ride was created, in milliseconds since Epoch.
closedTime (number) : ? The time the ride was closed, in milliseconds since Epoch. null for active rides.
isRideLocationAvailable (boolean) : Whether there are new updates on the ride location. The updates can be monitored via | HereMobilitySDKDemand#registerToRideUpdates .
currentStatus (RideStatus) : The current ride status.
previousStatuses (Array<RideRecord>) : A list of the previous statuses, ordered by timestamp in descending order.

RideRecord

RideRecord
Properties
status (RideStatus) : The ride status.
timestamp (number) : The timestamp of the status, in milliseconds since Epoch.

RideLocation

The current location of the ride.

RideLocation
Properties
rideId (string) : The ride ID.
vehicleLocation (LatLng) : ? Current location of the vehicle, if available.
estimatedPickupTime (number) : ? If the passenger was already picked up, will return the known pickup time.
estimatedDropOffTime (number) : ? If the vehicle already arrived, will return the known drop-off time.
lastUpdateTime (number) : Timestamp of this update, in milliseconds since Epoch.

PassengerDetails

The details of a passenger.

PassengerDetails
Properties
name (string) : The full name (first and last) of the passenger.
phoneNumber (string) : The phone number of the passenger.
photoUrl (string) : ? Optional. A URL pointing to a photo of the passenger. null if doesn't exist.
email (string) : ? Optional. The email of the passenger, if exists. Return {@code null} if doesn't exist.

CancellingParty

Which party cancelled the ride.

CancellingParty
Properties
DEMANDER (string) : The demander cancelled the ride.
SUPPLIER (string) : The supplier cancelled the ride.

CancellationStatus

The status of the cancellation request.

CancellationStatus
Properties
PROCESSING (string) : The cancellation request has been received and is now being processed. This value will be shown if there is a cancellation in progress, and this CancellationInfo is the result of Ride cancellationInfo. When receiving CancellationInfo as a result of HereMobilitySDKDemand#cancelRide , this will never be the result.
ACCEPTED (string) : The cancellation request was accepted.
REJECTED (string) : The cancellation request was rejected.
UNKNOWN (string) : The cancellation request is in unknown state.

CancellationInfo

Info about a ride cancellation.

CancellationInfo
Properties
cancellingParty (CancellingParty) : Who cancelled the ride.
cancelReason (string) : ? The reason for the cancellation.
requestTime (number) : The time the request was received at the marketplace.
status (CancellationStatus) : The current status of the cancellation request.

Ride

Active Ride.

Ride
Properties
userId (string) : ID of the user who ordered the ride.
rideId (string) : Ride ID, to be sent to the server.
route (RideWaypoints) : The route of the ride.
prebookPickupTime (number) : ? The requested pickup time in milliseconds since Epoch. Exists only for pre-booked rides.
bookingEstimatedPrice (PriceEstimate) : ? The price estimate, as was determined by booking time (will not be updated during the ride).
constraints (BookingConstraints) : The constraints of the booking (e.g. passenger count, suitcase count...)
statusLog (RideStatusLog) : The status log of the ride (current status and previous statuses).
supplier (Supplier) : ? The ride supplier. null if no supplier was assigned.
passenger (PassengerDetails) : The details of the passenger that is the contact for this ride.
passengerNote (string) : ? An optional custom note from the passenger to the supplier.
driver (DriverDetails) : ? The details of the driver. null if no driver was assigned.
vehicle (Vehicle) : ? The vehicle. null if no vehicle was assigned, or no vehicle info was supplied.
cancellationPolicy (CancellationPolicy) : The cancellation policy.
cancellationInfo (CancellationInfo) : ? If the ride was cancelled, contains info about the cancellation. Otherwise null

StatusFilter

StatusFilter

Type: ("PAST" | "FUTURE" | "ONGOING" | "ALL")

Properties
PAST (string) : Finished rides (includes the statuses: COMPLETED, REJECTED or CANCELLED) for the last 72 hours.
FUTURE (string) : Prebooked rides, up to 30 minutes before arrival time.
ONGOING (string) : Ongoing rides.
ALL (string) : All rides.

RideQuerySortType

RideQuerySortType

Type: ("UPDATE_TIME_ASC" | "UPDATE_TIME_DESC" | "CREATE_TIME_ASC" | "CREATE_TIME_DESC")

Properties
UPDATE_TIME_ASC (string) : Sort according to update time, ascending
UPDATE_TIME_DESC (string) : Sort according to update time, descending
CREATE_TIME_ASC (string) : Sort according to creation time, ascending
CREATE_TIME_DESC (string) : Sort according to creation time, descending

RideQuery

Query to get a list of rides according to given filters.

RideQuery
Properties
fromUpdateTime (number) : ? Return only rides that were updated since this time. The lowest allowed value is NOW - 3 Hours. If an earlier time is requested, only rides from the last 3 hours will be returned.
limit (number) : ? Limit number of results to return. If not given, the default is 200
statusFilter (StatusFilter) : ? Query only for rides with the given status filter. If not given, the default is 'ALL'
sortBy (RideQuerySortType) : ? In which order to sort the result. If not given, the default is 'UPDATE_TIME_ASC'

RideQueryResponse

Response to a RideQuery; contains the list of rides that match the query filters.

RideQueryResponse
Properties
rides (Array<Ride>) : List of rides matching the query filters.
fromTime (number) : Optional, The earliest update time in this result set. Given in seconds since Epoch.
toTime (number) : The latest update time in this result set. Given in seconds since Epoch.

RideOfferBase

Base class for ride offers.

RideOfferBase
Properties
type (TransitType) : optional, The type of the offer.
route (RideWaypoints) : The suggested route. May be different from the requested route.
estimatedPickupTime (number) : optional, Estimated pickup time, if provided by the supplier. The time is in milliseconds since Epoch.
estimatedDropOffTime (number) : optional, Estimated drop-off time, if provided by the supplier. The time is in milliseconds since Epoch.
estimatedDurationMs (number) : optional, Estimated duration of the ride, in milliseconds, if can be estimated.
estimatedPrice (PriceEstimate) : optional, Price estimation, if provided by the supplier.

TaxiRideOffer

Taxi Ride offer.

TaxiRideOffer
Properties
offerId (string) : The offer ID, to be sent to the server. Not applicable for public transport offers.
supplier (Supplier) : The supplier.
expirationTime (number) : is in milliseconds since Epoch.
cancellationPolicy (CancellationPolicy) : Ride cancellation policy.

PublicTransportRideOffer

Public Transport ride offer.

PublicTransportRideOffer
Properties
transfers (number) : Number of transport changes to reach the destination.
legs (Array<PublicTransportRouteLeg>) : A list of transportation sections for the route.

TransportMode

The transport mode of this leg.

TransportMode

Type: ("UNKNOWN" | "HIGH_SPEED_TRAIN" | "INTERCITY_TRAIN" | "INTER_REGIONAL_TRAIN" | "REGIONAL_TRAIN" | "CITY_TRAIN" | "BUS" | "FERRY" | "SUBWAY" | "LIGHT_RAIL" | "PRIVATE_BUS" | "INCLINED" | "AERIAL" | "BUS_RAPID" | "MONORAIL" | "WALK")

Properties
UNKNOWN (string) : Unknown mode.
HIGH_SPEED_TRAIN (string) : High-speed train.
INTERCITY_TRAIN (string) : Intercity train.
INTER_REGIONAL_TRAIN (string) : Inter-regional train.
REGIONAL_TRAIN (string) : Regional train.
CITY_TRAIN (string) : City train.
BUS (string) : Bus.
FERRY (string) : Ferry or boat.
SUBWAY (string) : Subway or metro.
LIGHT_RAIL (string) : Light rail.
PRIVATE_BUS (string) : Private bus.
INCLINED (string) : Inclined elevator or Funicular.
AERIAL (string) : Aerial leg (e.g. Cable car)
BUS_RAPID (string) : Bus rapid.
MONORAIL (string) : Monorail.
WALK (string) : Walking leg.

PublicTransportRouteLeg

Leg in the Public Transport Route.

PublicTransportRouteLeg
Properties
transportMode (TransportMode) : The transport mode of this leg.
estimatedDurationMs (number) : ? The estimated duration of this leg, in milliseconds, if known.
length (number) : ? The length of the leg in meters, if known in advance.
lineName (string) : ? The name of the line. null if transportMode is #transportmode , otherwise always exist.
operatorName (string) : ? The operator of the line.
origin (Waypoint) : The start point of the leg.
estimatedDepartureTime (number) : ? The estimated departure time, if known. Given in milliseconds since epoch.
destination (Waypoint) : The end point of the leg.
estimatedArrivalTime (number) : ? The estimated arrival time, if known. Given in milliseconds since epoch.

RideOffers

Ride Offer object.

new RideOffers(offers: Array<RideOfferBase>)
Parameters
offers (Array<RideOfferBase>)
Instance Members
all()
taxiOffers()
publicTransportOffers()

User

Represents a user.

User
Properties
userId (string) : The unique ID of the user.
expirationSec (number) : The expiration of the hash, in seconds since Epoch.
hash (string) : Signed hash that contains the userId and expiration seconds.