HereSDKDemandManager

@interface HereSDKDemandManager : NSObject

A factory class for HereSDKDemandClient.

  • Returns the shared demand manager.

    Declaration

    Objective-C

    @property (readonly, nonatomic, class)
        HereSDKDemandManager *_Nonnull sharedManager;

    Swift

    class var shared: HereSDKDemandManager { get }
  • Returns the current HERE SDK version.

    Declaration

    Objective-C

    @property (readonly, nonatomic, class) NSString *_Nonnull version;
  • An object conforming to the HereSDKDemandRidesUpdatesDelegate method that receives messages related to the open rides updates.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        id<HereSDKDemandRidesUpdatesDelegate> _Nullable ridesUpdatesDelegate;

    Swift

    weak var ridesUpdatesDelegate: HereSDKDemandRidesUpdatesDelegate? { get }
  • Starts monitoring all open rides. Rides monitoring is only possible, if the phone number is verified. This can be checked by calling [HereSDKManager.sharedManager isVerified]. If monitoring is not possible, the delegate method didReceiveUpdateError: will be called.

    Declaration

    Objective-C

    - (void)registerForRidesUpdatesWithDelegate:
        (nonnull id<HereSDKDemandRidesUpdatesDelegate>)delegate;

    Swift

    func registerForRidesUpdates(with delegate: HereSDKDemandRidesUpdatesDelegate)

    Parameters

    delegate

    The delegate that will receive ride updates.

  • Stops monitoring open rides

    Declaration

    Objective-C

    - (void)unregisterForRidesUpdates;

    Swift

    func unregisterForRidesUpdates()
  • Starts monitoring a ride. Ride monitoring is only possible, if the phone number is verified. This can be checked by calling [HereSDKManager.sharedManager isVerified]. If monitoring is not possible, the handler will be called with phone verification error.

    Declaration

    Objective-C

    - (void)registerUpdatesForRide:(nonnull NSString *)rideId
                       withHandler:(nonnull HereSDKDemandRideUpdateBlock)handler;

    Swift

    func registerUpdates(forRide rideId: String, withHandler handler: @escaping HereSDKDemandRideUpdateBlock)

    Parameters

    rideId

    The ride’s identifier.

    handler

    The handler for receiving updates.

  • Stops monitoring a ride

    Declaration

    Objective-C

    - (void)unregisterUpdatesForRide:(nonnull NSString *)rideId;

    Swift

    func unregisterUpdates(forRide rideId: String)

    Parameters

    rideId

    The ride’s identifier.

  • Request ride offers that match a given request.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the request parameter was invalid.
    • HereSDKDemandClientErrorInvalidCoordinate Invalid coordinate values for pickup or destination locations.
    • HereSDKDemandClientErrorInvalidDate Invalid prebook pickup time.
    • HereSDKDemandClientErrorInvalidMaxWalkingDistancePublicTransport Invalid maximum walking distance in transit options.
    • HereSDKDemandClientErrorInvalidMaxTransfersPublicTransport Invalid max transfers value in transit options.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorAuthExpired
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)requestRide:(nonnull HereSDKDemandRideOffersRequest *)request
            withHandler:(nonnull void (^)(
                            NSArray<id<HereSDKDemandRideOfferProtocol>> *_Nullable,
                            NSError *_Nullable))handler;

    Swift

    func requestRide(_ request: HereSDKDemandRideOffersRequest, withHandler handler: @escaping ([HereSDKDemandRideOfferProtocol]?, Error?) -> Void)

    Parameters

    request

    The HereSDKDemandRideOffersRequest object containing the ride constraints (e.g. numbers of passengers and suitcases).

    handler

    The block that will handle the response, with an array of offers, if successful, or an error, if an error has occurred.

  • Create a new ride object with the given offer ID.

    Warning

    Requires the user to be verified. Use HereSDKManager.sharedManager.isUserVerified to check verification status.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the request parameter was invalid.
    • HereSDKDemandClientErrorOfferExpired The requested offer has expired.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorPhoneNotVerified
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)createRideWithRequest:(nonnull HereSDKDemandRideRequest *)request
                      withHandler:(nonnull void (^)(HereSDKDemandRide *_Nullable,
                                                    NSError *_Nullable))handler;

    Swift

    func createRide(with request: HereSDKDemandRideRequest, withHandler handler: @escaping (HereSDKDemandRide?, Error?) -> Void)

    Parameters

    request

    The HereSDKDemandRideRequest object containing the offerId.

    handler

    The block that will handle the response, with a ride object, if successful, or an error, if an error has occurred.

  • Query for rides with the given statuses and update time.

    Warning

    Requires the user to be verified. Use HereSDKManager.sharedManager.isUserVerified to check verification status.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the request parameter was invalid.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorPhoneNotVerified
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)getRides:(nonnull HereSDKDemandRideQuery *)query
         withHandler:(nonnull void (^)(HereSDKDemandQueryRidesResponse *_Nullable,
                                       NSError *_Nullable))handler;

    Swift

    func getRides(_ query: HereSDKDemandRideQuery, withHandler handler: @escaping (HereSDKDemandQueryRidesResponse?, Error?) -> Void)

    Parameters

    query

    The HereSDKDemandRideQuery object containing the filters on ride statuses and update time.

    handler

    The block that will handle the response, with a rides response, if successful, or an error, if an error has occurred.

  • Cancel a ride related to a given request.

    Warning

    Requires the user to be verified. Use HereSDKManager.sharedManager.isUserVerified to check verification status.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the request parameter was invalid.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorPhoneNotVerified
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)cancelRideWithRequest:(nonnull HereSDKDemandCancelRideRequest *)request
                      withHandler:
                          (nonnull HereSDKDemandRideCancellationBlock)handler;

    Swift

    func cancelRide(with request: HereSDKDemandCancelRideRequest, withHandler handler: @escaping HereSDKDemandRideCancellationBlock)

    Parameters

    request

    The HereSDKDemandCancelRideRequest object representing the ride to be cancelled.

    handler

    The block that will handle the response, with cancellation info, if successful, or an error, if an error has occurred.

  • Get a ride by rideId.

    Warning

    Requires the user to be verified. Use HereSDKManager.sharedManager.isUserVerified to check verification status.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the rideId parameter was invalid.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorPhoneNotVerified
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)getRideWithRequest:(nonnull NSString *)rideId
                   withHandler:(nonnull void (^)(HereSDKDemandRide *_Nullable,
                                                 NSError *_Nullable))handler;

    Swift

    func getRideWithRequest(_ rideId: String, withHandler handler: @escaping (HereSDKDemandRide?, Error?) -> Void)

    Parameters

    rideId

    The ID of the ride to retrieve.

    handler

    The block that will handle the response, with a ride object, if successful, or an error, if an error has occurred.

  • Get ride payment information for a specific ride.

    Warning

    Requires the user to be verified. Use HereSDKManager.sharedManager.isUserVerified to check verification status.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the rideId parameter was invalid.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorPhoneNotVerified
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)getRidePaymentForRideId:(nonnull NSString *)rideId
                        withHandler:
                            (nonnull void (^)(HereSDKDemandRidePayment *_Nullable,
                                              NSError *_Nullable))handler;

    Swift

    func getRidePayment(forRideId rideId: String, withHandler handler: @escaping (HereSDKDemandRidePayment?, Error?) -> Void)

    Parameters

    rideId

    The ID of the ride to retrieve.

    handler

    The block that will handle the response, with a ride payment object, if successful or an error, if an error has occurred.

  • Get the verticals coverage available around a specific location This request will return a mask of all available TransitTypes around the given location.

    Note

    Can return HereSDKDemandClientError for request related errors, or HereSDKNetworkError and HereSDKAuthError for network or authentication errors:

    • HereSDKDemandClientErrorInternal When the request parameter was invalid.
    • HereSDKDemandClientErrorInvalidCoordinate Invalid coordinate values.
    • HereSDKNetworkErrorNotAvailable
    • HereSDKNetworkErrorAuthExpired
    • HereSDKAuthenticationError

    Declaration

    Objective-C

    - (void)
    getVerticalsCoverageWithRequest:
        (nonnull HereSDKDemandVerticalsCoverageRequest *)request
                        withHandler:
                            (nonnull void (^)(
                                HereSDKDemandVerticalsCoverageResponse *_Nullable,
                                NSError *_Nullable))handler;

    Swift

    func getVerticalsCoverage(with request: HereSDKDemandVerticalsCoverageRequest, withHandler handler: @escaping (HereSDKDemandVerticalsCoverageResponse?, Error?) -> Void)

    Parameters

    request

    The HereSDKDemandVerticalsCoverageRequest object.

    handler

    The block that will handle the response, , with a coverage response, if successful, or an error, if an error has occurred.