Skip to content

Ticketmaster

Andrew Clunis edited this page Aug 30, 2021 · 3 revisions

Integrating with Ticketmaster Presence SDK

Rover Campaigns includes support for integrating with the Ticketmaster Presence SDK. This will allow your team to surface some Ticketmaster information within the Rover Audience and Campaigns tools.

The integration is indirect; you integrate both the Presence SDK and the Rover Campaigns SDK into your app, and write a little bit of glue code.

Installing the Module

Add the Ticketmaster module:

target 'MyAppTarget' do
    ...
    pod 'RoverCampaigns/Ticketmaster'   '~> 3.4'
end

And initialize it in your RoverCampaigns.initialize invocation:

RoverCampaigns.initialize(assemblers: [
    ...
    TicketmasterAssembler()
])

Then you need to configure a PresenceLoginDelegate in your view controller hosting the Presence SDK (as described in the Presence SDK documentation), and then from there you'll resolve Rover Campaigns' TicketmasterAuthorizer object and call methods on it to keep Rover Campaigns up to date on Ticketmaster logins.

First, set the user's Ticketmaster credentials into Rover after a successful sign-in with the Presence SDK. Implement the onMemberUpdated(backendName:member:) method in the delegate and call setCredentials method and passing in values from the PresenceMember.

extension MyViewController: PresenceLoginDelegate {
    func onMemberUpdated(backendName: PresenceLogin.BackendName, member: PresenceMember) {
        RoverCampaigns.shared?.resolve(TicketmasterAuthorizer.self)?.setCredentials(
            id: member.id,
            email: null,
            firstName: null
        )
    }
}

Note: We no longer recommend setting First Name and email to the values provided by the Presence SDK: these are redacted and are not of use.

Then clear the user's Ticketmaster credentials after a successful sign-out with the Presence SDK. Implement the onLogoutAllSuccessful() method in the delegate and call the clearCredentials method.

extension MyViewController: PresenceLoginDelegate {
    func onLogoutAllSuccessful() {
        Rover.shared?.resolve(TicketmasterAuthorizer.self)?.clearCredentials()
    }
}
Clone this wiki locally