To integrate Presence SDK in your application, you will need the latest release of the Presence SDK for iOS.
Requirements for using Swift 5.2.4 build
To build, you must use Xcode 11.2.x and the iOS 13.2.x+ SDK
Requirements for using Swift 5.3.0 build
To build, you must use Xcode 11.3.x and the iOS 13.3.x+ SDK
Only Portrait Orientation Supported.
iPhone support only.
Minimum iOS 11.0, supported through iOS 13.x
Offline Ticket Mode, which allows fans to access their tickets without a network connection, also requires that the app be accessible offline.
Beta versions of Xcode and swift are not supported.
If migration is done from version prior to 1.28.0, it is required to access PSDK.getPresenceSDK() instead of PresenceSDK.getPresenceSDK().
Instruction for integrators:
Open find navigator in Xcode
Choose Replace -> Regular Expression
Paste text below as Regular Expression (?<!import)(?<!\/\/ )(\W)(PresenceSDK)(\W)
Paste text below as Replace With $1PSDK$3
Choose “Matching Case” option
Press Replace All
Importing The SDK
Follow these simple steps to integrate and configure the SDK.
Note: If using CocoaPods, you can skip step 1.
Step 1: Drag and drop the PresenceSDK.framework, iOSExperienceSDK.framework, and Presence.framework into your project’s General -> Embedded Binaries settings (copy items if needed) (Skip step if using Cocoapods)
Step 2: Go to your app’s AppDelegate file and import the PresenceSDK module. You may delete the line where UIKit is being imported if you like. In the PresenceSDK module, UIKit is already being imported for you.
Step 3: Create a configurePresenceSDK() method inside your AppDelegate class. In this method, the account credentials and branding color will be configured.
Note: 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!
Step 4: Call the configurePresenceSDK() method in the application(: didFinishLaunchWithOptions:) function.
Configure Experience SDK
Presence SDK is packaged with Experience SDK and you have to embed both the frameworks to use Presence SDK. If you don’t want to use Experience SDK in your client app than please skip this step but if your client app also wants to provide Experience SDK features than you will also need to configure it. Please reach out to firstname.lastname@example.org for Experience integration questions and configuration values.To configure Experience SDK please use this convenient method:
You can call this method from didFinishLaunchingWithOptions() method in your AppDelegate class.
Setting Up the Views
Now that we’ve imported the SDK into your project we can set up the views to display the UI.
In your storyboard, create a UIViewController or you may use the preset one provided by XCode when a new project is created. This UIViewController will be the starting point for Presence SDK.
Step 1: Drag and drop a UIView from the Object Library (located in the Utility panel) inside this UIViewController. For this UIView, in the Identity Inspector, change the class to PresenceSDKView and Module to PresenceSDK. Finally, set the constraints to the UIView to the edges of the View Controller.
Step 2: You will need to allow the user to logout in some fashion. We recommend using a UIBarButtonItem on the top right corner of the Navigation Item (see example below), but this is not required. You just need to reference the PresenceSDK.getPresenceSDK().logOut() method wherever you want to call the log out function. Please note that the .logout() call will log out both Host and Archtics accounts. Please see the Logout Methods section below under iOS Presence SDK Reference Guide lower on this screen for more information on logout functionality.
Example Logout Functionality: Like the UIView from step 1, drag and drop a UIBarButtonItem onto the Navigation Item of the View Controller. If the View Controller doesn’t have a Navigation item, you may drag and drop from the Object Library before adding a UIBarButtonItem. Double click the UIBarButtonItem’s title and type in “Logout”.
You may now run the application and if you have provided correct configuration, you will see a similar screen to the image below at startup.
IMPORTANT: If your project is in Objective-C, you will get a run time fatal error:
dyld: Library not loaded: @rpath/libswiftContacts.dylib
Referenced from: */Frameworks/PresenceSDK.framework/PresenceSDK
Reason: image not found. To fix this error, in your project build settings, set YES for Always Embed Swift Standard Libraries under Build Options.
NOTE: Further setup required. You still need to configure your application to handle PresenceSDK events.
Configuring Your ViewController
Note: This is a basic example for configuring the ViewController
Step 3: Import the PresenceSDK module. Again, UIKit is imported automatically when importing PresenceSDK, so if you like, you may delete the import UIKit code-line.
Step 4: Create an IBOutlet to the UIView you setup in step 1. When the outlet is created, please make sure the view is of type PresenceSDKView. Make sure that you connect this new outlet to the PresenceSDKView in the storyboard. If you used our example logout, remember to also, create an IBAction method called logout for the UIBarButtonItem you setup in step 2. In the method logout, call the logOut method in the PresenceSDK.
Step 5: Conform your ViewController to PresenceLoginDelegate and implement the required and optional protocol methods:
Step 6: Start PresenceSDK inside viewDidLoad() life cycle method.
We’ve also added the ability to start the login flow for specific backend environments. Please see the example below:
Step 7: If you need to get information for logged in member, you can use one the protocol methods.
Your ViewController’s implementation should look like this:
You have finish integrating PresenceSDK. Now, you may run the application, if everything was configured properly, you should see your tickets once you log in.
iOS Presence SDK Reference Guide
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 UIImage object. 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
Configure your branding color with a UIColor object
Configure Team Theme
Configure your team’s theme as SDKTheme.Light (default) or SDKTheme.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, then immediately dismiss the presenceSDKView. All that you need to do is utilize the following PresenceLoginDelegate method which you implemented in step 5:
Once the user has successfully logged in, you can then dismiss or hide the presenceSDKView for later viewing at your leisure.
Note: onLoginSuccessful gets called for each account that is logged in. So in the instance of having a team and host account logged in, the onLoginSuccessful delegate method will be fired off twice.
Following methods are provided for logging out of the Presence SDK. Logout is now asynchronous so
it is recommended to use the completion handlers or PresenceLoginDelegate methods for notification
about logout completion.
A simple Logout handler function can look like this:
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.
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 notifications together with the payload data.
Notifications - 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.
If you want to track ACTION_MANAGETICKETSCREENSHOWED event you should add an observer inside your ViewController’s viewDidLoad() method like this:
And the notification handler will look something like this:
Following section describes the steps you need to follow to prepare your app for the App Store.
PresenceSDK is packaged as a Universal binary and it contains binary packages for all valid architectures including ARMv* and x86. This is great for development as you can run your app on both devices and simulators but for App Store submission you need to strip the simulator packages from your App. To do this we have provided “strip_frameworks.sh” file, just add this file to the Run Script phase under your app’s Build Phases settings and it will do the work for you. Here is a screenshot of what your Build phases will look like after adding this file: