Flutter SDK
Integrate Instalog into your Flutter applications
Installation
Install the Instalog Flutter SDK by adding it as a dependency in your project. You can find the package on pub.dev.
To include the SDK, add the following dependency to your pubspec.yaml
file:
Platform-specific Setup
Android
For feedback functionality on Android, ensure you have the Instalog activity registered in your AndroidManifest.xml:
Usage
Initialization
Initialize the Instalog SDK at the start of your app:
Configuration Options
Customize Instalog SDK behavior with InstalogOptions
:
All configuration options default to true
except for isLoggerEnabled
(defaults to false
).
Logging Events
Track custom events with optional parameters:
Showing Feedback Modal
Display the in-app feedback modal to collect user input:
Crash Reporting
Instalog automatically captures uncaught exceptions when set up with crash.setup()
. To manually report a caught exception:
User Identification
Associate events with a specific user:
Identifying users allows you to track user-specific behavior and associate events and crashes with particular users, which is helpful for debugging and analytics.
Testing Crash Reporting
Simulate a crash to test your implementation:
Platform-Specific Notes
iOS
Ensure you have added the necessary permissions to your Info.plist
file if your app collects user data.
Android
If targeting Android 13 (API level 33) or higher, ensure you request the appropriate permissions for collecting user data.
Advanced Example
Here’s a complete example showing how to use multiple Instalog features together:
Troubleshooting
Common Issues
-
SDK Not Initialized
- Ensure
initialize()
is called before using other SDK methods - Verify your API key is correct
- Ensure
-
Missing Crash Reports
- Check that crash reporting is enabled in your configuration
- Verify your app has network permissions
-
Events Not Being Logged
- Check network connectivity
- Ensure the SDK is properly initialized
For additional support, contact [email protected]