1.1.0
HereMobilitySDK is the client wrapper for accessing the HereSDKManager API.
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.
Request ride offers that match a given request.
(RideOffersRequest)
Ride offers request parameters.
(function (response: RideOffers?, error: Object?): void)
Callback which will be called with the result. The first parameter is the ride offers array. The second parameter is the error (if any).
Book a ride and create a new ride object with the given offer ID.
(string)
The ride offer ID received from getRideOffers
(PassengerDetails)
Details about the passenger booking the ride (name, phone number, photo URL).
(RidePreferences?)
Get a ride by rideId.
Cancel a ride
(string)
The ID of the ride to be cancelled.
(string)
The cancellation reason.
(function (cancellationInfo: CancellationInfo?, err: Object?): void)
A callback which returns information about the cancellation request (e.g. whether the request was accepted or rejected) and errors if any.
Query for rides with the given statuses and update time.
(RideQuery?)
A RideQuery object that contains fields specifying ride update times and statuses with which you want to filter results.
(function (response: RideQueryResponse?, error: Object?): void)
Callback which will be called with the query results. The first parameter is an array of rides, the second is the error(if any).
Register for ride updates. NOTE: Only one simultaneous registration for all types of updates is possible from this module.
(function (ride: Ride, rideStatusLog: RideStatusLog): void)
A callback for handling errors
(function (ride: Ride, rideLocation: RideLocation): void)
(function (error: HereMobilityDemandError?): void)
Unregister for ride updates.
Represents a location on the planet, defined as a (latitude, longitude) pair.
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.
(string)
: Optional, the country name.
(string)
: Optional, the ISO 3166 Alpha 3 country code.
(string)
: Optional, the state name (if relevant).
(string)
: Optional, the city name.
(string)
: Optional, the district name (if relevant).
(string)
: Optional, the street name.
(string)
: Optional, the house number.
(string)
: Optional, the postal code.
(string)
: Optional, the county (second subdivision level below the country).
(string)
: Optional, the sub-district (subdivision level below the district; e.g. commonly used in IND).
(string)
: Optional, the building name (e.g. commonly used in HKG).
Waypoint Type, that encapsulates a LatLng type, and additional information.
The route of the ride, composed of the pickup location and the destination.
Range of the price.
Options relevant to public transport offers.
(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.
(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.
(string)
: Optional, the locale to use for the
PublicTransportRideOffer
. Complies with the ISO 639-1 standard. The default is "EN".
Constraints that the supplier must fulfill for the current booking.
Request from the SDK to the server for ride offers.
(RideWaypoints)
: The requested route.
(BookingConstraints)
: Optional, conditions that the supplier must accommodate, such as number of passengers, wheelchair access, etc.
(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)
: Optional price range acceptable to the passenger.
(RideOfferRequestSortType)
: Optional sort type. If not given, the order is by price, and then by ETA.
(String)
: Optional note from the passenger.
(TransitOptions)
: Optional Transit options. This will affect the public transport offers.
*
The type of the offer.
Type:
("TAXI"
| "PUBLIC_TRANSPORT"
)
Price object with the amount to pay and the currency.
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:
(Price)
: The fixed price, if exists. The fixed price. Null if the estimation is a range.
(PriceRange)
: The price range, if exists. The price range. Null if the estimation is a fixed price.
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);
}
Type:
("UNKNOWN"
| "ALLOWED"
| "NOT_ALLOWED"
)
Supplier details.
HereMobilityDemandError
Type: {reason: string}
(string)
Preferences of a ride.
(boolean)
: Specifies if messages about the ride will be sent to the passenger. Default is false.
Details of a driver.
Type:
("NOT_SUPPLIED"
| "STANDARD"
| "LIMO"
| "VAN"
| "OTHER"
)
Vehicle details.
(string)
: License plate number.
(VehicleType)
: The type of the vehicle.
(string)
: The manufacturer of the vehicle.
(string)
: The vehicle model.
The ride status.
Type:
("PROCESSING"
| "REJECTED"
| "ACCEPTED"
| "DRIVER_ASSIGNED"
| "DRIVER_EN_ROUTE"
| "AT_PICKUP"
| "PASSENGER_ON_BOARD"
| "AT_DROP_OFF"
| "COMPLETED"
| "CANCELLED"
| "UNRECOGNIZED"
)
(string)
: The request is being "processed" looking for a supplier.
(string)
: None of the suppliers accepted the offer. No driver was assigned.
(string)
: A supplier accepted the "ride" no driver was assigned yet.
(string)
: A driver was assigned to the ride.
(string)
: The vehicle is on the way to the pickup point.
(string)
: The vehicle is waiting at the pickup point.
(string)
: The vehicle is on the way to the drop-off point.
(string)
: The vehicle arrived at the drop-off point.
(string)
: The ride was completed.
(string)
: The ride was cancelled (either by the driver or by the passenger)
(string)
: Unrecognized status of the ride
A ride's status log. Contains the current status, and a chronological list of previous statuses (ordered by timestamp in descending order).
(number)
: Timestamp of the last update, in milliseconds since Epoch.
(number)
: The time the ride was created, in milliseconds since Epoch.
(number)
: ? The time the ride was closed, in milliseconds since Epoch. null for active rides.
(boolean)
: Whether there are new updates on the ride location. The updates can be monitored via
| HereMobilitySDKDemand#registerToRideUpdates
.
(RideStatus)
: The current ride status.
(Array<RideRecord>)
: A list of the previous statuses, ordered by timestamp in descending order.
(RideStatus)
: The ride status.
(number)
: The timestamp of the status, in milliseconds since Epoch.
The current location of the ride.
(string)
: The ride ID.
(LatLng)
: ? Current location of the vehicle, if available.
(number)
: ? If the passenger was already picked up, will return the known pickup time.
(number)
: ? If the vehicle already arrived, will return the known drop-off time.
(number)
: Timestamp of this update, in milliseconds since Epoch.
The details of a passenger.
(string)
: The full name (first and last) of the passenger.
(string)
: The phone number of the passenger.
(string)
: ? Optional. A URL pointing to a photo of the passenger. null if doesn't exist.
(string)
: ? Optional. The email of the passenger, if exists. Return {@code null} if doesn't exist.
Which party cancelled the ride.
The status of the cancellation request.
(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.
(string)
: The cancellation request was accepted.
(string)
: The cancellation request was rejected.
(string)
: The cancellation request is in unknown state.
Info about a ride cancellation.
(CancellingParty)
: Who cancelled the ride.
(string)
: ? The reason for the cancellation.
(number)
: The time the request was received at the marketplace.
(CancellationStatus)
: The current status of the cancellation request.
Active Ride.
(string)
: ID of the user who ordered the ride.
(string)
: Ride ID, to be sent to the server.
(RideWaypoints)
: The route of the ride.
(number)
: ? The requested pickup time in milliseconds since Epoch. Exists only for pre-booked rides.
(PriceEstimate)
: ? The price estimate, as was determined by booking time (will not be updated during the ride).
(BookingConstraints)
: The constraints of the booking (e.g. passenger count, suitcase count...)
(RideStatusLog)
: The status log of the ride (current status and previous statuses).
(Supplier)
: ? The ride supplier. null if no supplier was assigned.
(PassengerDetails)
: The details of the passenger that is the contact for this ride.
(string)
: ? An optional custom note from the passenger to the supplier.
(DriverDetails)
: ? The details of the driver. null if no driver was assigned.
(Vehicle)
: ? The vehicle. null if no vehicle was assigned, or no vehicle info was supplied.
(CancellationPolicy)
: The cancellation policy.
(CancellationInfo)
: ? If the ride was cancelled, contains info about the cancellation. Otherwise null
Type:
("PAST"
| "FUTURE"
| "ONGOING"
| "ALL"
)
Type:
("UPDATE_TIME_ASC"
| "UPDATE_TIME_DESC"
| "CREATE_TIME_ASC"
| "CREATE_TIME_DESC"
)
Query to get a list of rides according to given filters.
(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.
(number)
: ? Limit number of results to return. If not given, the default is 200
(StatusFilter)
: ? Query only for rides with the given status filter. If not given, the default is 'ALL'
(RideQuerySortType)
: ? In which order to sort the result. If not given, the default is 'UPDATE_TIME_ASC'
Response to a RideQuery; contains the list of rides that match the query filters.
Base class for ride offers.
(TransitType)
: optional, The type of the offer.
(RideWaypoints)
: The suggested route. May be different from the requested route.
(number)
: optional, Estimated pickup time, if provided by the supplier. The time is in milliseconds since Epoch.
(number)
: optional, Estimated drop-off time, if provided by the supplier. The time is in milliseconds since Epoch.
(number)
: optional, Estimated duration of the ride, in milliseconds, if can be estimated.
(PriceEstimate)
: optional, Price estimation, if provided by the supplier.
Taxi Ride offer.
(string)
: The offer ID, to be sent to the server. Not applicable for public transport offers.
(Supplier)
: The supplier.
(number)
: is in milliseconds since Epoch.
(CancellationPolicy)
: Ride cancellation policy.
Public Transport ride offer.
(number)
: Number of transport changes to reach the destination.
(Array<PublicTransportRouteLeg>)
: A list of transportation sections for the route.
The transport mode of this leg.
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"
)
(string)
: Unknown mode.
(string)
: High-speed train.
(string)
: Intercity train.
(string)
: Inter-regional train.
(string)
: Regional train.
(string)
: City train.
(string)
: Bus.
(string)
: Ferry or boat.
(string)
: Subway or metro.
(string)
: Light rail.
(string)
: Private bus.
(string)
: Inclined elevator or Funicular.
(string)
: Aerial leg (e.g. Cable car)
(string)
: Bus rapid.
(string)
: Monorail.
(string)
: Walking leg.
Leg in the Public Transport Route.
(TransportMode)
: The transport mode of this leg.
(number)
: ? The estimated duration of this leg, in milliseconds, if known.
(number)
: ? The length of the leg in meters, if known in advance.
(string)
: ? The name of the line. null if transportMode is
#transportmode
, otherwise always exist.
(string)
: ? The operator of the line.
(Waypoint)
: The start point of the leg.
(number)
: ? The estimated departure time, if known. Given in milliseconds since epoch.
(Waypoint)
: The end point of the leg.
(number)
: ? The estimated arrival time, if known. Given in milliseconds since epoch.
Ride Offer object.
(Array<RideOfferBase>)
An array of rides offers.
Array<RideOfferBase>
:
An array of ride offers.
An array of taxi ride offer.
Array<TaxiRideOffer>
:
An array of taxi offers.
An array of public transport ride offer.
Array<PublicTransportRideOffer>
:
An array of public transport ride offers.
Represents a user.