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
environmentThe 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 methodDeclaration
Swift
public static func applyStyle(_ style: Style)Parameters
styleThe 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 methodDeclaration
Swift
public static func addEventListener(_ eventListener: EventListener)Parameters
eventListenerThe 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 methodDeclaration
Parameters
flowThe Flow you wish to present (e.g. in-path or standalone)
presentingViewControllerThe 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 methodDeclaration
Swift
public static func requestPrice(searchContext: SearchContext, completion: @escaping PriceRequestCompletionHandler)Parameters
searchContextContext information for the search (dates, location, passengers…)
completionCompletion 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 methodDeclaration
Swift
public static func getInPathUpsellWidgetModel() -> InPathWidgetModel
View on GitHub
BookingGoCars Class Reference