Build a sample app to evaluate the Tealeaf iOS SDK

Before you start integrating the Tealeaf SDK into your app, we recommend installing our sample app with the SDK.

Requirements

  • Acoustic Tealeaf. To view captured sessions and playback from the sample app, you need an active Tealeaf subscription.
  • Development environment. To build and run the sample app, you need Xcode 15 with Command Line Tools and a recent CocoaPods version.
  • Mobile app compatibility. You can run the sample app on simulators and real devices. iOS 13 or later is required.

Before you begin

During the setup, you will need to register the sample app with your Acoustic Tealeaf credentials. You can generate them yourself through the Tealeaf interface.

  1. Log in to Acoustic Tealeaf as an administrator.
  2. In the menu bar, click on your user profile and select Admin.
  1. On the Admin page, open the Applications tab.
  1. If a new app is required, click to add an app and fill out required settings.
  2. Click the SDK link for your app. Copy access credentials from the code snippet on the iOS tab: application code and post message URL. Keep them handy for the setup.

Initial setup

  1. Clone the sample app code from GitHub.
git clone https://github.com/acoustic-analytics/SwiftUIMindBlowing.git
  1. Install the pods and make sure the command is completed with no errors. If you get an error, run the same command with the--verbose option and share the error log with our services team.
cd SwiftUIMindBlowing
pod install
  1. Open the SwiftUIMindBlowing.xcworkspace file (not SwiftUIMindBlowing.xcodeproj).
  1. Confirm that you trust the workspace and want to open it.
  2. In Xcode, open a basic configuration file SwiftUIMindBlowing-main/Pods/TealeafDebug/SDKs/iOS/Debug/TLFResources.bundle/TealeafBasicConfig.plist and update 2 keys in it using your Tealeaf credentials: AppKey and PostMessageUrl.
Entering Tealeaf credials to configuration file

📘

Note

This is a quick and dirty way to change the library configuration. Next time you update the Pods in the sample app, TealeafBasicConfig.plist will be overwritten. That is why when you integrate the library into your app, we will advise you to use AppDelegate.

  1. In the SwiftUIMindBlowing target, open the Signing & Capabilities tab. In the Signing section, replace the default Team and Bundle Identifier with your own.
  2. Build and run the app.

Test session replay

Now you can check how user behavior data is captured.

  1. Click around in the sample app.
  2. In your Tealeaf account, go to Session Search and view your session. To learn more about the Sessions module, see Session replay in our help centre.
Session search in Tealeaf

📘

Note

User sessions in Tealeaf time out after 30 minutes of inactivity.