Build a sample app to evaluate the Tealeaf Flutter SDK
Before you start integrating the Tealeaf SDK into your Flutter-based 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 a standard Flutter environment.
- Mobile app compatibility. You can run the sample app on simulators and real devices. Supported operating systems: iOS 13-15, Android 5.0 (API level 21) and later.
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 any tab: application code and post message URL. Keep them handy for the setup.
Setup instructions
- Clone the sample app code from our GitHub repository.
git clone https://github.com/go-acoustic/Tealeaf-Flutter
- Update the project using the pub package manager.
cd Tealeaf-Flutter
flutter clean && flutter pub get
cd example/gallery
flutter clean && flutter pub get
- Navigate to the iOS project directory, delete podfile.lock and then update Pods.
cd Tealeaf-Flutter/example/gallery/ios
rm podfile.lock
pod update
- Open the primary configuration file:
Tealeaf-Flutter/example/gallery/TealeafConfig.json
. Update 2 keys in it using your Tealeaf credentials:AppKey
andPostMessageUrl
. - Start a target device (iOS or Android).
- Change to the project directory and run the sample app from there.
cd Tealeaf-Flutter/example/gallery
flutter run
If using an IDE, keep the following in mind:
- To open the iOS version with Xcode, use the
Tealeaf-Flutter/example/gallery/iOS/Runner.xcworkspace
file (notTealeaf-Flutter/example/gallery/ios/Runner.xcodeproj
). - For the Android version, open the following directory in Android Studio:
Tealeaf-Flutter/example/gallery
.
Test session replay
Now you can check how user behavior data is captured.
- Run the sample app and click around.
- In your Tealeaf account, go to Optimise > Session search.
- Find the session and click to play it back.
Notes:
- To learn more about the Sessions module, see Session replay in our marketing guide.
- User sessions in Tealeaf time out after 30 minutes of inactivity.
Updated 6 days ago