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.
- Log in to Acoustic Tealeaf as an administrator.
- In the menu bar, click on your user profile and select Admin.
- On the Admin page, open the Applications tab.
- If a new app is required, click to add an app and fill out required settings.
- 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
- Clone the sample app code from GitHub.
git clone https://github.com/acoustic-analytics/SwiftUIMindBlowing.git
- 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
- Open the SwiftUIMindBlowing.xcworkspace file (not SwiftUIMindBlowing.xcodeproj).
- Confirm that you trust the workspace and want to open it.
- 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
andPostMessageUrl
.
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.
- In the SwiftUIMindBlowing target, open the Signing & Capabilities tab. In the Signing section, replace the default Team and Bundle Identifier with your own.
- Build and run the app.
Test session replay
Now you can check how user behavior data is captured.
- Click around in the sample app.
- 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.
Note
User sessions in Tealeaf time out after 30 minutes of inactivity.
Updated 2 months ago