BookingGoCars

public class BookingGoCars

Provides entry-points to the SDK

  • Completion handler for making a request for a price via requestPrice

    Declaration

    Swift

    public typealias PriceRequestCompletionHandler = (Result<IndicativePrice, APIError>) -> Void
  • Prepares the SDK for use with a specified environment (default is production)

    Declaration

    Swift

    public static func initialize(withEnvironment environment: Environment)

    Parameters

    environment

    The environment (e.g. test or production) the SDK should work against

  • Applies a style (i.e. your brand colours/fonts) to the UI components of the SDK

    Precondition

    initialize must be called before calling this method

    Declaration

    Swift

    public static func applyStyle(_ style: Style)

    Parameters

    style

    The Style you wish to apply

  • Adds a listener that will be notified when analytics events are fired

    Precondition

    initialize must be called before calling this method

    Declaration

    Swift

    public static func addEventListener(_ eventListener: EventListener)

    Parameters

    eventListener

    The listener that will be notified when analytics events are fired.

  • Modally presents a flow from a specified view controller

    Precondition

    initialize must be called before calling this method

    Declaration

    Swift

    public static func present(_ flow: Flow, from presentingViewController: UIViewController, completion: Flow.CompletionHandler?)

    Parameters

    flow

    The Flow you wish to present (e.g. in-path or standalone)

    presentingViewController

    The view controller from which to present the view

    completion

    (Optional) completion handler where any potential/requested booking object is returned when the flow completes

  • Make a request for a price based on a search context

    Precondition

    initialize must be called before calling this method

    Declaration

    Swift

    public static func requestPrice(searchContext: SearchContext, completion: @escaping PriceRequestCompletionHandler)

    Parameters

    searchContext

    Context information for the search (dates, location, passengers…)

    completion

    Completion handler when a result is available (or an error occurs)

  • Make a request to retrieve a #InpathUpsellWidgetModel that can be used to populate an in-path upsell widget.

    Precondition

    The SDK must be initialized to use this method

    Declaration

    Swift

    public static func getInPathUpsellWidgetModel() -> InPathWidgetModel