Fullstory for Flutter Mobile Apps allows you to capture user events and important details about their session to better understand your user's experience with your app. This data can be used to analyze key metrics, understand user journeys through your app, and identify drop-off points in your most important user funnels. Data from your Flutter apps can be combined in Fullstory with sessions from your website and other mobile apps to provide a comprehensive view of your digital experience.
Note: Visual session replay for Flutter apps is on the roadmap, but not yet supported. At this time, custom events as well as most other non-visual APIs (e.g. Identify Users, Logging) are supported.
To get started with Fullstory for Flutter Mobile Apps:
- Install the
fullstory_flutter
dart library by running the following command in the root directory of your flutter app:flutter pub add fullstory_flutter
This will also install the Fullstory Coacoapod for iOS apps. However the Android library will need to be installed separately. - Next, follow the below guides to configure this for your Android or iOS apps.
Android Apps: Install and configure the Android library by following our our Getting Started with Android Data Capture guide.
iOS Apps: Configure iOS starting from Step 1: Adding the Fullstory framework via CocoaPods Pod > Add the Build Phase in our Getting Started with iOS Data Capture guide. Note, in Step 1, you'll skip over the Add the Plugin step found under the via CocoaPods Pod instructions and begin immediately with the 'Add the Build Phase' instructions. - Import the library into your dart code and begin using the API:
// Upon user login // The second parameter is optional and can be updated later by calling FS.setUserVars()
FS.identify('462718483', {
'displayName': 'Daniel Falko',
'email': 'daniel.falko@example.com', });
// Update user details
// Arbitrary keys and values are allowed
// displayName and email get special treatment by Fullstory
FS.setUserVars({
'displayName': 'Daniel Falko',
'email': 'daniel.falko@example.com',
'membershipLevel': 'platinum',
});
// Upon user log out
FS.anonymize();
// Create custom events
FS.event('new thing created');
// ...with optional properties
FS.event('new thing created', {'name': 'foo', 'value': 2.5});
// Get the Fullstory session URL
// Will be null if there is no current session, see FSStatusListener
FS.getCurrentSessionURL().then((url) => print("Fullstory session url: $url"));
// Log messages
// Logs will appear in Dev tools > Console section of Fullstory playback
// Errors will also appear in the event list at the right
// Supported log levels are: log, debug, info, warn, error
FS.log(level: FSLogLevel.error, message:"Exception caught: $e");
// Get notified when the Fullstory session has started
// (The mixin can also be added to existing classes and widgets)
class MyStatusListener with FSStatusListener {
MyStatusListener() {
FS.setStatusListener(this);
}
@override
void onFSSession(String url) {
print("Fullstory session started: $url");
}
}
var listener = new MyStatusListener();
For more information on our Mobile APIs, please check out our our Developer Documentation. Additionally, you can refer to our Fullstory Flutter GitHub for working examples of our APIs.