To integrate Presence SDK in your application, you will need the latest release of the Presence SDK for Android.
New Presence SDK Integration Demo Project
To gain insight on how to properly integrate the Presence SDK in your app or for help with a step below, you may download and reference this demo project.
Presence SDK Version 1.22.x and higher requires Android X and is no longer compatible with older Android Support Libraries
Supported API level 21 ~ 29.
SDK now request for android.permission.READ_EXTERNAL_STORAGE
com.ticketmaster.presence:secure-entry library updated to 1.2.2
androidx.activity:activity-ktx library updated to 1.3.1
androidx.fragment:fragment library updated to 1.3.6
Only Portrait Orientation Supported.
Offline Ticket Mode, which allows fans to access their tickets without a network connection, also requires that the app be accessible offline.
In step 7 below, you will be required to enter your scheme name. To get your scheme name, please reach out to your local Ticketmaster representative.
Java 1.8
Step 9 Optional: If your app supports transfer tickets via SMS, you must add the following permission to your Android Manifest.xml file.
Permissions
INTERNET
ACCESS_NETWORK_STATE
READ_CONTACTS
WAKE_LOCK
Importing The SDK
Follow these steps to integrate and configure the SDK into your Android project.
Step 1. Download the Android Presence Sdk
Step 2. In Android Studio with your project open, from the file menu: File -> New -> New Module -> Import .JAR / .AAR package and locate the Presence SDK .aar file downloaded in the previous step.
Step 3. Open your app module’s build.gradle file enable Java 1.8
and add the following dependencies:
If you have any dependencies that are already declared in your project you can skip those dependencies from this list. For example you might have the constraintlayout dependency in your project so you can skip adding constraintlayout from this list.
In your repositories add jcenter(), it might be located in your build.gradle or settings.gradle and sync the project with the new gradle changes.
Step 4. Open your application’s AndroidManifest.xml file and add the attribute tools:replace="android:theme" to the application tag like so:
Step 5Create a new layout file named activity_psdk_host.xml and paste in the following xml:
Step 6Create a new Activity name PresenceSdkHostActivity and replace the generated code with the following code:
BuildConfig.CONSUMER_KEY - To get consumer key please create an account on https://developer.ticketmaster.com and register your app and it will generate a consumer key that can be used in the above method. Before you can use Presence SDK you will have to provide the generated consumer key together with consumer secret and redirect URI to Presence SDK support team so we can configure your app on our end!
BuildConfig.TEAM_NAME - The team name for the integrator’s application. (ex. “Kansas City Chiefs”)
NOTE: Create all the BuildConfig values in your app’s build.gradle file.
NOTE: Be aware that you NEED to pass the ApplicationContext object (NOT activity context) to PresenceSDK.getPresenceSDK(Context context) method. If it is not an Application Context, the Presence SDK might reject and throw a runtime exception with a message to bring it to the developer’s attention.
NOTE: Do you wait for the configuration callback before calling start? You can also call PresenceSDK.getPresenceSDK(,,).setConfig() much sooner in your app to avoid timing issues. setConfig is async so it can lead to a race condition if you don’t wait for it to respond.
We have also added the ability to start to login flow for specific backend environments. Please see the example below:
Step 7: Instructions for Modern Accounts Login
For Modern Accounts Logins, open the AndroidManifest.xml and add the following ModernAccountsLoginActivity:
NOTE: Please reach out to your local Ticketmaster representative to get your scheme name that will be input above where it states your_scheme_goes_here.
NOTE: Your scheme should be all lowercase of form psdkscheme[client scheme name] example for scheme name “horns” would “psdkschemehorns”
Step 8Copy the following xml inside your application tag of your AndroidManifest.xml file
NOTE: replace com.your.company with your package name.
Step 9 Optional: If your app supports transfer tickets via SMS, you must add the following permission to your Android Manifest.xml file.
Step 10 Optional: Sometimes, PresenceSDK needs to recognize that the environment was set for the UK region. To fix this issue, You will need to the following method before calling the start method on the PresenceSDK class.
Step 11 Run the application
This will load the entry fragment (UI shown below) where a login screen will prompt users to login with their Team and/or Ticketmaster account.
Step 12: Instructions for onLogoutSuccessful and onLogoutAllSuccessful
From the SDK, it is possible that logout could be initiated inside SDK so the handling of onLogoutSuccessful() and onLogoutAllSuccessful() is obligatory now, otherwise you can get an empty view.
For example, onLogoutSuccessfull the application can quit or initiate a new Login flow in this case if needed. In onLogoutSuccessful() handler you should check whether the just logged out account was the last one.
EXAMPLE:
If the application forces PresenceSDK.logOut() it is not necessary to launch a new Login flow immediately. Better to do it in onLogoutSuccessful()
NOTE:It is also recommended to handle onLoginCancelled() callback in the same way
Android Presence SDK Reference Guide
SportXR Onboarding
PresenceLoginListener Methods
The PresenceLoginListener interface has the below contract. You can implement all methods here using this interface or use the SimplePresenceLoginListener in the code
sample above to selectively include the methods you want.
Jump to Order / Jump to Event
We have revamped our Jump to Order and Jump to Event logic. If event is found for given id, the method opens the list of tickets related to the found event. If order is found for given id, the method opens the list of tickets related to the found order.
Configure Brand Logo
Configure your brand logo with a resourceID of the image you would like to use. This image will show up in the linking screen replacing the brand abbreviation.
If you do not set a brand logo, then the abbreviation will work like before. Ex: TicketMaster becomes TM.
Specifying a Branding Color
Presence sdk clients can set their own branding theme color by defining this color value in their application resource “colors.xml” file:
The defined color will be displayed on all action buttons, action bars and ticket details page. If the above color variable is not defined in the client’s apk project, Tmx sdk will use a default color.
Also, there is a way to change the color at run time.
The defined color will be displayed on all action buttons, action bars and ticket details page. If the above color variable is not defined in the client’s apk project, Tmx sdk will use a default color.
Configure Team Theme
Configure your team’s theme as PresenceSdkTheme.Light (default) or PresenceSdkTheme.Dark. The theme configuration lets PresenceSDK
know how to setup various UI elements to contrast with branding color. For example, if branding
color is in the dark color spectrum, a Light theme configuration will color various UI elements white.
This will allow crucial UI element to be visible to the user.
Configure Login Item
Because Account Manager’s website only supports Forgot Password OR Create account, we have updated the SDK to do the same to remove confusion for your users. by default if not specified, you will see Forgot Password.
Suppress View After Login
Presence SDK gives the ability to allow the user to login, and not display the event list. All you need to do is utilize the following overloaded startLoginFlow method with the corresponding backend name.
Once the user has succesfully logged in, you can then dismiss or hide the view.
Logout Methods
You can implement log out functionality on your UI with by calling these API:
Note: Please note that a fan’s tickets will no longer be available on the device for offline viewing if logout is called, as it will clear the cache.
Check Login Status
Presence SDK also provides some helper methods for checking if user is logged into any of the supported services.
Global Methods
Venue Concession Integration
How to integrate Presence SDK with a Venue Concessions SDK (such as Venue Next SDK):
Analytics
Presence SDK provides support for tracking user activity via its Analytics module.
For tracking user activity in the Presence SDK a separate class PresenceEventAnalytics is provided that lists all the user actions that are notified via local broadcast manager notifications together with the payload data.
Notification Events – You can observe these notifications to receive updates from Presence SDK.
Payload Data for the Notifications – Only relevant information is sent out with the notification.
Analytics Usage
If you want to track ACTION_MANAGETICKETSCREENSHOWED event, you should register a local broadcast listener as below:
You can implement receiver mAnalyticsEventReceiver as follows:
Event/Order/Ticket information
You now can have the data about the event and ticket with the new PresenceOrderDelegate interface to use this interface. You need to implement the interface PresenceOrderDelegate in the view where you want to get this information and pass this interface to the presenceSDK via
so when a user gets their events, the function didUpdateEvents from the interface will be called and will return all the events of the user. And when the user enters to some event, the function didUpdateTickets from the interface will be called and will return all the tickets with the information of them.