Presence SDK Migration, iOS
  • 06 Mar 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Presence SDK Migration, iOS

  • Dark
    Light

Article summary

Summary

The old Ticketmaster Presence SDK framework has been replaced by two new frameworks:

  • Tickets: Post-Purchase functionality such as viewing purchased Events, Tickets, and Barcodes

  • Authentication: Authentication functionality such as Login, Logout, Refresh Tokens, and Member Info

Below is a list of class and method name mapping between the old Presence 1.X or 2.X and the new Authentication 1.X and Tickets 3.X.

Properties

Presence frameworkTickets/Authentication frameworks
PSDK.sharedTMTickets.shared
PSDK.shared.versionTMTickets.shared.version
PSDK.shared.orderDelegateTMTickets.shared.orderDelegate
PSDK.shared.moduleDelegateTMTickets.shared.moduleDelegate
PSDK.shared.loginDelegateTMAuthentication.shared.delegate
PresenceEventAnalytics notificationsTMTickets.shared.analyticsDelegate

Configuration

For a source code example, see Example Tasks: Configuration

Presence frameworkTickets/Authentication frameworks
PSDK.shared.setConfig(consumerKey: ...)TMAuthentication.shared.configure(apiKey: ...) and TMTickets.shared.configure(success:failure)
PSDK.shared.checkConfig(success:failure:)not needed anymore, as success/error blocks are now part of: TMTickets.shared.configure(success:failure)
PSDK.shared.start(presenceView:)TMTickets.shared.start(ticketsView:)

Authentication

Note that all Authentication related methods have been moved to TMAuthentication.shared.

For a source code example, see Example Tasks: Authentication

Presence frameworkAuthentication framework
PSDK.shared.loginDelegateTMAuthentication.shared.delegate
PSDK.shared.login(...)TMAuthentication.shared.login(...)
PSDK.shared.hostLoginQueryParamsTMAuthentication.shared.login(backend: .HostModernAccounts, loginProperties: ...)
PSDK.shared.archticsLoginQueryParamsTMAuthentication.shared.login(backend: .TeamModernAccounts, loginProperties: ...)
PSDK.shared.sportXRLoginQueryParamsTMAuthentication.shared.login(backend: .SportXR, loginProperties: ...)
PSDK.shared.isLoggedIn()TMAuthentication.shared.hasUnexpiredToken()
PSDK.shared.isLoggedIntoHost()TMAuthentication.shared.hasUnexpiredToken(backend: .HostModernAccounts)
PSDK.shared.isLoggedIntoTeam()TMAuthentication.shared.hasUnexpiredToken(backend: .TeamModernAccounts)
PSDK.shared.isLoggedIntoSportXR()TMAuthentication.shared.hasUnexpiredToken(backend: .SportXR)
PSDK.shared.hasUserSignedIn()TMAuthentication.shared.hasToken()
PSDK.shared.hasUserSignedInHost()TMAuthentication.shared.hasToken(backend: .HostModernAccounts)
PSDK.shared.hasUserSignedInTeam()TMAuthentication.shared.hasToken(backend: .TeamModernAccounts)
PSDK.shared.hasUserSignedInSportXR()TMAuthentication.shared.hasToken(backend: .SportXR)
PSDK.shared.getAccessToken(...)TMAuthentication.shared.validToken(...)
PSDK.shared.getMemberInfo(...)TMAuthentication.shared.memberInfo(...)
PSDK.shared.startMFAValidation(...)TMAuthentication.shared.validateMFAToken(...)
PSDK.shared.logout(...)TMAuthentication.shared.logout(backend: nil, ...)
PSDK.shared.logOutHost(...)TMAuthentication.shared.logout(backend: .HostModernAccounts, ...)
PSDK.shared.logOutTeam(...)TMAuthentication.shared.logout(backend: .TeamModernAccounts, ...)
PSDK.shared.logOutSportXR(...)TMAuthentication.shared.logout(backend: .SportXR, ...)
PresenceOAuthProviderTMAuthenticationProvider

Operations

Presence frameworkTickets framework
PSDK.shared.jumpToOrderOrEvent(id:type:action:)TMTickets.shared.display(orderOrEventId:type:action:)
PSDK.shared.setTicketsActionButton(title: "foo")TMTickets.shared.ticketsNavBarButtonText = "foo"
PSDK.shared.getTicketsActionBarButtonText()let text = TMTickets.shared.ticketsNavBarButtonText
PSDK.shared.setUserTracking(enabled: false)TMTickets.shared.userTrackingEnabled = false

Branding

By default Tickets inherits basic branding from Authentication via TMAuthentication.Branding passed into TMAuthentication.shared.configure(brandedServiceSettings:success:failure).

So the following methods are optional unless you need to customize Tickets branding beyond the basic branding provided by Authentication.

Presence frameworkTickets framework
PSDK.shared.setBrandingColors(...)TMTickets.shared.brandingColorsOverride = TMTickets.BrandingColors()
PSDK.shared.enableTMBrandingColorOverride()TMTickets.shared.brandingColorButtonOverride = true
PSDK.shared.doNotBrandNavBar()TMTickets.shared.brandingColorNavBarOverride = true
PSDK.shared.setLogo(...)TMTickets.shared.brandingTeamLogoImage = UIImage()
PSDK.shared.setTheme(theme:)theme is now part of TMAuthentication.Branding and TMTickets.BrandingColors

Custom Modules

Presence frameworkTickets framework
PSDK.shared.moduleDelegateTMTickets.shared.moduleDelegate
PresenceModuleDelegateTMTicketsModuleDelegate
- addCustomModules(eventOrders:completion:)- addCustomModules(event:completion:)
- handleModuleActionButton(moduleIdentifier:buttonTitle: callbackValue:eventOrders:completion:)- handleModuleActionButton(event:module:button: completion:)
- userDidPressActionButton(moduleIdentifier:buttonTitle: callbackValue:eventOrders:)TMTicketsAnalyticsDelegate.userDidPerform(action: .moduleActionButton, metadata:)
PSDKTicketsModuleTMTicketsModule
PresenceModuleHeaderViewTMTicketsModuleHeaderView
PSDKTicketsModule.accountManagerSeatUpgrades(...)TMTicketsPrebuiltModule. accountManagerSeatUpgrades(...)
PSDKTicketsModule.accountManagerMoreTicketActions(...)TMTicketsPrebuiltModule. accountManagerMoreTicketActions(...)
PSDKTicketsModule.venueDirectionsViaAppleMaps(...)TMTicketsPrebuiltModule. venueDirectionsViaAppleMaps(...)
PSDKTicketsModule.venueConcessions(...)TMTicketsPrebuiltModule.venueConcessions(...)

Order Delegate

All User-behavior analytics have been moved to TMTicketsAnalyticsDelegate.

The remaining methods in TMTicketsOrderDelegate represent either:

  • non-analytics: actions that require your application to do something, such as handleNavBarButtonAction
  • analytics that are not based on User-behavior: such as didUpdateEvents
Presence frameworkTickets framework
PSDK.shared.orderDelegateTMTickets.shared.orderDelegate
PresenceOrderDelegateTMTicketsOrderDelegate
- presentEventDetailsPage(...)no longer used
- presentArtistDetailsPage(...)no longer used
- presentVenueDetailsPage(...)no longer used
- presentClientAppPage(...)- presentClientAppPage(...)
- handleBarButtonAction(page: screenTitleName:eventOrders:) and handleBarButtonAction(page: buttonTitle:eventOrders:)- handleNavBarButtonAction(page: screenTitleName:event:)
- didUpdateEvents(eventOrderArray:) and didUpdateOrderedEvents()- didUpdateEvents(events:fromCache:)
- didUpdateTickets(eventOrders:) and didUpdateTickets(eventId:)- didUpdateTickets(event:fromCache)
- didPresentEventList()TMTicketsAnalyticsDelegate.userDidView(page: .events, metadata:)
- didPresentTicketList()TMTicketsAnalyticsDelegate.userDidView(page: .eventTickets, metadata:)

Analytics Delegate

Old notification-based PresenceEventAnalytics have been replaced with a simplier TMTicketsAnalyticsDelegate.

Presence frameworkTickets framework
PresenceEventAnalytics notificationsTMTickets.shared.analyticsDelegate
PresenceEventAnalyticsTMTicketsAnalyticsDelegate
- userDidView(page:metadata:)
- userDidPerform(action:metadata:)

Login Delegate

Note that all Authentication related methods have been moved to TMAuthentication.shared.

The same Authentication-related information is available via:

  • TMAuthentication.shared.delegate
  • TMAuthentication.shared**.registerStateChanged**(block:)
  • TMAuthentication.AuthNotification

For the purposes of comparison to the old Presence framework, the TMAuthenticationDelegate methods are listed below:

Presence frameworkAuthentication framework
PSDK.shared.loginDelegateTMAuthentication.shared.delegate
PresenceLoginDelegateTMAuthenticationDelegate
- onLoginWindowDidDisplay(...)- onStateChanged(backend:state: .loginPresented, error:)
- onLoginForgotPasswordClicked(...)no longer used
- onLoginMethodUsed(...)- onStateChanged(backend: backend, state: .loggedIn, error:)
- onLoginSuccessful(...)- onStateChanged(backend:state: .loginCompleted, error:)
- onLoginCancelled(...)- onStateChanged(backend:state: .loginAborted, error:)
- onLoginFailed(...)- onStateChanged(backend:state: .loginFailed, error:)
- onTokenRefreshed(...)- onStateChanged(backend:state: .tokenRefreshed, error:)
- onRefreshTokenFailed(...)no longer used, see: TMTickets.shared.validToken(... failure: ...)
- onRefreshTokenExpired(...)no longer used, see: TMTickets.shared.validToken(...)
- onLogoutSuccessful(...)- onStateChanged(backend:state: .loggedOut, error:)
- onLogoutFailed(...)no longer used, as logout can no longer fail
- onLogoutAllSuccessful()- onStateChanged(backend:state: .logoutCompleted, error:)
- onMemberUpdated(...)no longer used, see: TMTickets.shared.memberInfo(...)
- onCacheCleared()TMTicketsOrderDelegate.didClearEventsTicketsCache(...)

Other Class Name Changes

Presence frameworkTickets/Authentication frameworks
PSDKTMTickets
PSDK.HostEnvironmentTMAuthentication.TMXDeploymentRegion
PSDK.SDKEnvironmentTMAuthentication.TMXDeploymentEnvironment
PSDK.BackendNameTMAuthentication.BackendService
PSDK.BrandingColorsTMTickets.BrandingColors or TMAuthentication.Branding
PSDK.SDKThemeTMAuthentication.ColorTheme
PSDK.errorDomainTMTickets.TicketsError.domain
PresenceViewControllerTMTicketsViewController
PresenceViewTMTicketsView

Data Models

Presence frameworkTickets framework
PresenceMemberTMMemberInfo
PresenceEventOrdersTMPurchasedEvent
PresenceEventTMPurchasedEventInfo
PresenceOrderTMPurchasedOrder
PresenceTicketTMPurchasedTicket


Was this article helpful?

What's Next