- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
An optional Action button can be added to the top right of the Tickets Nav Bar.
Hidden Action Button
By default, this Action button is hidden:
TMTickets.shared.navBarButtonTitle = nil
Custom Action Button
You can set the title of the Action button to any string you want, though preferrably something short:
TMTickets.shared.navBarButtonTitle = "Help"
TMTickets.shared.navBarButtonTitle = "Chat"
Relevant Action Button Pages
The Action button will be shown on the top right of the Tickets Page, Back of Ticket Page, and Barcode Page:
Ticket | Back of Ticket | Barcode |
---|---|---|
Button Functionality
Pressing the Action button does not do anything by itself. The Tickets SDK does not currently have any built-in operations, such as Help or Chat.
If you enable the Action button, you must handle the button's functionality yourself in the TMTicketsOrderDelegate:
// set your class as the orderDelegate
TMTickets.shared.orderDelegate = self
/// optional delegate to be informed of non-analytics User-actions
extension MyClass: TMTicketsOrderDelegate {
/// Method is invoked if the client app needs to handle the navBar button
///
/// - Parameters:
/// - page: SDK page where button was pressed
/// - screenTitleName: title of screen where button was pressed
/// - event: current Event and purchased Orders being viewed (if any)
func handleNavBarButtonAction(
page: TicketmasterTickets.TMTickets.Analytics.Page,
screenTitleName: String?,
event: TicketmasterTickets.TMPurchasedEvent?) {
// TODO: handle Action button operation yourself
// for example, open a webpage, or a native ViewController, or some other SDK
if let event = event {
if let name = screenTitleName {
print("User Pressed NavBar Button on Page: \(page.rawValue) Named: \(name) Event: \(event.info.identifier)")
} else {
print("User Pressed NavBar Button on Page: \(page.rawValue) Event: \(event.info.identifier)")
}
} else if let name = screenTitleName {
print("User Pressed NavBar Button on Page: \(page.rawValue) Named: \(name)")
} else {
print("User Pressed NavBar Button on Page: \(page.rawValue)")
}
}
Was this article helpful?