Presence SDK Migration, Android
  • 29 Jun 2023
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Presence SDK Migration, Android

  • 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 SDKTickets SDK
PresenceSDKTicketsSDKClient
TicketsSDKSingleton
PresenceSDK.SDKEnvironmentTicketsSDKSingleton.SDKEnvironment
PresenceSDK.HostEnvironmentTicketsSDKSingleton.HostEnvironment
PresenceSDK.ActionTypeTicketsSDKSingleton.ActionType
PresenceSDK.EventIdTypeTicketsSDKSingleton.EventIdType
PresenceSDK.MemberInfoCompletionCallbackNot needed anymore, to retrieve the member info see fetchUserDetails() in TMAuthentication
PresenceSDK.setCanShowHelp()/getCanShowHelp()TicketsSDKSingleton.canShowHelp
PresenceSDK.getPresenceModuleDelegate()TicketsSDKSingleton.moduleDelegate
PresenceSDK.getPresenceOrderDelegate()TicketsSDKSingleton.orderDelegate

Configuration

For a source code example, see Example Tasks: Configuration

Presence SDKTickets SDK
PresenceSDK.start(...)TicketsSDKClient.Builder().start(context:Context)
Creates a new instance of TicketsSDKClient. Then its needed to be added in TicketsSDKSingleton
TicketsSDKSingleton.setTicketsSdkClient(client: TicketsSDKClient)
set the TicketsSDKClient instance for the singleton
PresenceSDK.getPresenceSDKTicketsSDKSingleton
Singleton object that saves the current TicketsSDKClient
PresenceSDK.setConfig(...)See Builder in TMAuthentication
PresenceSDK.setEnvironment()TicketsSDKClient.setEnvironment()
PresenceSDK.registerContextMenuListener()TicketsSDKSingleton.registerContextMenuListener()
PresenceSDK.unregisterContextMenuListener()TicketsSDKSingleton.unregisterContextMenuListener()
PresenceSDK.isExperienceEnabled()not needed anymore
PresenceSDK.needInvalidateCache()TicketsSDKSingleton.needInvalidateCache()
PresenceSDK.stop()not needed anymore as ConfigListener is no longer needed.
PresenceSDK.clearCache()not needed anymore
PresenceSDK.displayOrder()not needed anymore
PresenceSDK.getMemberInfo()See fetchUserDetails() in TMAuthentication
PresenceSDK.getVersionNumber()TicketsSDKSingleton.getVersionNumber()
PresenceSDK.getSdkState()not needed anymore
PresenceSDK.registerConfigListener()not needed anymore as the configuration now is retrieved when calling the build() function in TMAuthentication
PresenceSDK.unregisterConfigListener()not needed anymore as the configuration now is retrieved when calling the build() function in TMAuthentication
PresenceSDK.canGoBack()not needed anymore
PresenceSDK.presentOrderUpgrade()TicketsSDKSingleton.presentOrderUpgrade()

Authentication

Note that all Authentication related methods have been moved to TMAuthentication
For a source code example, see Example Tasks: Authentication

Presence SDKTMAuthentication SDK
PresenceSDKTMAuthentication
PresenceSDK.SDKEnvironmentTMXDeploymentEnvironment
PresenceSDK.HostEnvironmentTMXDeploymentRegion
PresenceSDK.setEnvironment()TMAuthentication.environment
Part of TMAuthentication.Builder, define the enviroment that TMAuthentication will be working
PresenceSDK.setConfig(HostEnviroment, ...)TMAuthentication.region
Part of TMAuthentication.Builder, define the region that the TMAuthentication will be working.
PresenceSDK.setConfig(
modernAccountsQuickLogin:boolean, ...
)
TMAuthentication.modernAccountsQuickLogin
Part of TMAuthentication.Builder, set the boolean for modern accounts quick login.
PresenceSDK.setConfig(
moderAccountsAutoQuickLogin:boolean,...
)
TMAuthentication.modernAccountsAutoQuickLogin
Part of TMAuthentication.Builder, set the boolean for modern accounts quick auto login.
PresenceSDK.setHostLoginQueryParams(...)TMAuthentication.hostMALoginParameters
Part of TMAuthentication.Builder set login parameters for host.
PresenceSDK.setArchticsLoginQueryParams(...)TMAuthentication.archticsMALoginParameters
Part of TMAuthentication.Builder set login parameters for archtics.
PresenceSDK.registerConfigListener()TMAuthentication.configuration
Configuration of the consumer apikey. It is generated when build() method is called.
PresenceSDK.setLoginAccountOptionButton()Not needed anymore
PresenceSDK.logIn()Removed method, and moved all logic to Authentication
PresenceSDK.startLoginFlow(...)TicketsSDKSingleton.getLoginIntent(activity:FragmentActivity)
Generates new intent that will launch Login from Authentication. If the resultCode it's Activity.RESULT_CANCELED it means the login wasn't successful.
PresenceSDK.startMfaValidation(...)TMAuthentication.getMFAIntent()
Generates new intent that will launch MFA validation. If the resultCode it's Activity.RESULT_CANCELED it means the validation wasn't successful.
TMAuthentication.getDeviceVerificationToken() Returns a Device Verification token previously obtained through the Multifactor Authentication process (MFA)
PresenceSDK.hasUserSignedIn()TMAuthentication.getToken(AuthSource) Return a valid token for the signed in account. Null if no account tried to log in.
PresenceSDK.getMemberInfo()TMAuthentication.fetchUserDetails() Fetch user details for the current session
PresenceSDK.logOut()TicketsSDKSingleton.logout() and TMAuthentication.logout()
PresenceSDK.logOutHost()Part now of TMAuthentication.logout()
PresenceSDK.logOutTeam()Part now of TMAuthentication.logout()
PresenceSDK.getAccessToken()TMAuthentication.getToken(AuthSource)
Retrieve the access token if available, if not, token returns empty. Compare if not empty is logged in.
PresenceSDK.isLoggedIntoHost()See getToken(AuthSource.Host). Retrieve the access token if available, if not, token returns empty. Compare if not empty is logged in.
PresenceSDK.isLoggedIntoTeam()See getToken(AuthSource.Archtics) in TMAuthentication. Retrieve the access token if available, if not, token returns empty. Compare if not empty is logged in.
PresenceSDK.isLoggedIn()Validate if one of the functions isLoggedIntoHost or isLoggedIntoTeam returns true.
PresenceSDK.hasUserSignedIn()See getToken(AuthSource) in TMAuthentication
PresenceSDK.hasUserSignedIntoHost()See getToken(AuthSource)
PresenceSDK.hasUserSignedIntoTeam()See getToken(AuthSource)
PresenceSDK.resetPasswordForHost()not needed anymore
PresenceSDK.validateAccessToken()See getToken(AuthSource)

Operations

Presence SDKTickets SDK
PresenceSDK.jumpToOrderOrEvent()TicketsSDKSingleton.jumpToOrderOrEvent()

Branding

Tickets and Authentication define its colors on their corresponding Builder classes.
The other methods are optional, unless you need to customize Tickets branding beyond the basic branding.

Presence SDKAuthentication SDK / Tickets SDK
PresenceSdkBrandingColorTicketsColors
PresenceSDK.setBrandingColor(...)TicketsSDKClient.Builder().colors(colors: TicketsColors)
PresenceSDK.setBrandingColor(...)TMAuthentication.Builder().colors(colors: ColorTheme)
PresenceSDK.setTheme(...)TMTicketsThemeUtil.setTheme(...)
PresenceSDK.setLogoResourceId(...)BrandLogoHelper.setBrandLogoResourceId(...)
PresenceSDK.enableTMBrandingColorOverride(...)not needed anymore

Order Delegate

All User-behavior analytics have been moved to UserAnalyticsDelegate.
The remaining methods in TMTicketsOrderDelegate represent either:

  • non-analytics: actions that require your application to do something.
  • analytics that are not based on User-behavior: such as didUpdateEvents
PresenceOrderDelegateTicketsOrderDelegate
PresenceOrderDelegate.PresenceEventOrdersTicketsOrderDelegate.EventOrders
PresenceOrderDelegate.PresenceEventTicketsOrderDelegate.Event
PresenceOrderDelegate.didUpdateEvents(...)TicketsOrderDelegate.didUpdateEvents(eventOrdersArray:List)
PresenceOrderDelegate.didUpdateTickets(...)TicketsOrderDelegate.didUpdateTickets(eventOrders:EventOrders)

Module

PresenceModuleDelegateTicketsModuleDelegate
PresenceModuleDelegate.PresenceOrderTicketsModuleDelegate.Order
PresenceModuleDelegate.OrderInfoTicketsModuleDelegate.OrderInfo
PresenceModuleDelegate.PresenceTicketTicketsModuleDelegate.Ticket
PresenceModuleDelegate.PresenceTicketFeeTicketsModuleDelegate.TicketFee
PresenceModuleDelegate.PresenceDeliveryTicketsModuleDelegate.Delivery
PresenceModuleDelegate.DeliverySourceTicketsModuleDelegate.DeliverySource
PresenceModuleDelegate.LatLngTicketsModuleDelegate.LatLng

Analytics

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

PresenceEventAnalyticsUserAnalyticsDelegate
sendAnalyticEvent(...)sendAnalyticsEvent(AnalyticsData)
getLiveData()
Exposes the LiveData value to be observe receiving any changes in real time

Was this article helpful?