Baggage check-in

Start check-in

The BAGTAG EBT Framework will guide the passenger through the first steps of the process. Once the passenger is ready to update, a callback is triggered to start the check-in process.

Check-in is normally performed in the DCS. Depending on the requirement, the integration of the DCS can be done by the airline developers or by BAGTAG.

The end-result of the check-in, is all the data to be placed on the actual label. This label data is returned to the EBT Framework for further processing.

The example app demonstrates the use of the label data callback, by retrieving random generated label data. More information on the DCS integration, and label data formatting can be found in the DCS section of the site.

 

The app needs to provide the framework with the relevant label data. The information is requested when the passenger is ready to update the EBT.

The framework provides a delegate called: BAGTAGFrameworkDelegate.

The following example simply retrieves random label data from the BAGTAG server.

class FetchLabelData: BAGTAGFrameworkDelegate {
    func fetchBAGTAGData(completion:@escaping (String?) -> ()) {
        let url = URL(string: "https://sdktest-api.bagtag.com/api/flightdatapackage/")!

        let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
            guard let data = data, let testTag = String(data: data, encoding: .utf8) else { return }
            DispatchQueue.main.async {
                completion(testTag)
            }
        }

        task.resume()
    }

    func didCloseBAGTAGFramework() {
    }
}

Implement BagTagFragment.OnLoadIataDataListener as follows:

class MainActivity : BagtagLibraryActivity(), BagTagFragment.OnLoadIataDataListener {
    override fun getIataData(iataCallback: IATACallbackInterface) {
        Retrofit.Builder()
            .baseUrl("https://sdktest-api.bagtag.com")
            .addConverterFactory(ScalarsConverterFactory.create())
            .build()
            .create(ApiService::class.java)
            .getSampleFlightIataData()
            .enqueue(object : Callback {
                override fun onResponse(call: Call, response: Response) {
                    if (response.isSuccessful && response.body() != null) {
                        iataCallback.successfullyLoadedIataData(response = response.body() ?: "")
                    } else {
                        iataCallback.failedToLoadIataData()
                    }
                }

                override fun onFailure(call: Call, t: Throwable) {
                    iataCallback.failedToLoadIataData()
                }
            })
    }
}

In this callback method you only need to retrieve the signed BAGTAG data from your API and send it by calling:

iataCallback.successfullyLoadedIataData(YOUR_IATA_DATA_STRING)

Whenever you were not able to retrieve IATA data because an error occurred, or for example the server wasn’t reachable, call:

iataCallback.failedToLoadIataData()

Are we there yet?

Close! The last step is the final installation into the mobile app!



Any questions about integration? Reach out to integration@bagtag.com

We're here to help

Please fill in your details and we will contact you.