fetch

fun fetch(callback: (List<Order>?, SdkError?) -> Unit? = null)

Fetch the latest claimed orders with the server. An order is claimed if it is associated with the current customer. Most of the time this method does not need to be called by the app except for refreshing an order list.

Example:

FlyBuyCore.getInstance(appAuthId).orders.fetch { orders, sdkError ->
if (null != sdkError) {
// Handle error
} else {
// Handle success
}
}

fun fetch(redemptionCode: String, callback: (Order?, SdkError?) -> Unit? = null)

Fetch an unclaimed order using the redemptionCode. After the order is fetched, use claim to associate the order with the current customer which may start location tracking.

Example:

FlyBuyCore.getInstance(appAuthId).orders.fetch(redemptionCode) { order, sdkError ->
if (null != sdkError) {
// Handle error
} else {
// Handle success
}
}