Documentation
iOS ReferenceAndroid Reference
  • Overview
  • Release Notes
    • 2019 Release Notes
  • Quick Start
    • Configuration settings
  • Getting Started
    • Environments
    • Domain Whitelist
  • Traveler
    • Overview
    • Mobile SDKs
      • Overview
      • Minimum Requirements
      • iOS
        • Installation
        • Getting Started
      • Android
        • Installation
        • Getting Started
      • Usage
        • Booking Item Search
          • Booking Item Search UI
        • Flight Search
        • Catalog
        • Catalog Item Details
        • Availabilities
        • Getting Passes
        • Booking Form
          • Questions
          • Answers
          • Validation
        • Creating an Order
        • Processing an Order
      • Errors
    • Traveler API
    • Payments
  • Partner
    • Overview
    • Partner API
  • Glossary
    • API Convention
      • Error Codes
      • API Rate Limiting
    • Terminology
  • Support
    • Contact
Powered by GitBook
On this page

Was this helpful?

  1. Traveler
  2. Mobile SDKs
  3. Usage

Catalog Item Details

For every item presented in the Catalog you can fetch details such as locations, contact information, prices and etc using the following method.

let catalogItem = catalog.groups[0].items[0]
Traveler.fetchCatalogItemDetails(catalogItem) { (details, error) in

}

Alternatively you can use the delegate pattern

Traveler.fetchCatalogItemDetails(catalogItem, delegate: self)
extension MyViewController: CatalogItemDetailsFetchDelegate {
    func catalogItemDetailsFetchDidSucceedWith(_ result: CatalogItemDetails) }
    
    }
    
    func catalogItemDetailsFetchDidFailWith(_ error: Error) {
    
    }
}

It is recommended that you display the details of this item in a modal. The UI SDK ships with a storyboard for your convenience (CatalogItem.storyboard) so that if you wish to use our recommended flows from here all the way to making a booking, you can simply just use it as a reference in your own storybaords inside Xcode's Interface Builder. If you are not using storyboards, you can always instantiate the flow via code like below.

let storyboard = UIStoryboard(name: "CatalogItem", bundle: Bundle(for: CatalogItemViewController.self))
if let vc = storyboard.instantiateInitialViewController() {
    present(vc, animated: true)
}
Traveler.fetchCatalogItemDetails(catalogItem, new CatalogItemDetailsCallback() {
    @Override
    void onCatalogItemDetailsSuccess(CatalogItemDetails catalog) {
    
    }
    
    @Override
    void onCatalogItemDetailsError(Error error) {
    
    }
});

It is recommended that you display the details of this item in a separate Activity. The UI SDK ships with an Activity for your convenience (CatalogItemDetailsActivity) so that if you wish to use our recommended flows from here all the way to making a booking, you can simply just start that activity inside yours using the designated Intent like below

Intent i = TravelerUI.getCatalogItemDetailsIntent(catalogItem, this);
startActivity(i);

If you choose to use our recommended flow for the details screen and onwards, you can stop right here as our UI SDK will handle the rest all the way to booking and placing an order; however if you like to implement your own cusom UI and flow, you will be required to make a few more calls and collect more information from your user.

PreviousCatalogNextAvailabilities

Last updated 6 years ago

Was this helpful?