Flutter SDK
The InHouse Flutter SDK provides comprehensive tracking and analytics capabilities for your cross-platform mobile applications, including user behavior tracking, deep linking support, install attribution, and device fingerprinting.Installation
Dependencies
Add the SDK to yourpubspec.yaml:
Install Dependencies
Platform Setup
iOS Setup
- Minimum iOS Version
ios/Runner.xcodeproj:
- Configure URL Schemes in
ios/Runner/Info.plist:
- Add Associated Domains for universal links:
- Add Tracking Usage Description:
Android Setup
- Minimum SDK Version
android/app/build.gradle:
- Add Install Referrer Receiver to
android/app/src/main/AndroidManifest.xml:
- Configure Deep Link Intent Filters in your main activity:
Quick Start
Basic Setup
Initialize the SDK in your app:Handle App Lifecycle
Event Tracking
Track App Open
Track when users open your app:Track Session Start
Track user sessions:Track Short Link Clicks
Track when users interact with your short links:Screen Tracking
Track user navigation through your app:User Interaction Tracking
Track user actions and interactions:Install Attribution
Install Referrer Tracking
Track install attribution and referrer data:Real-time Event Callbacks
Listen to SDK events in real-time:Deep Link Handling
Handle incoming deep links from TryInHouse short links:Universal Links Configuration
For iOS universal links, add topubspec.yaml:
Device Fingerprinting
Thumbmark Integration (Android Only)
The SDK includes device fingerprinting capabilities on Android:Configuration Options
Debug Mode
Enable comprehensive logging during development:Error Handling
Implement comprehensive error handling:TryInHouse Platform Configuration
Configure Well-Known Files
-
Log in to TryInHouse Dashboard:
- Go to https://app.tryinhouse.co/
- Sign in to your account or create a new one
-
Navigate to Project Settings:
- Select your project from the dashboard
- Go to Settings → Linkings
- Configure iOS Universal Links (apple-app-site-association):
- Configure Android App Links (assetlinks.json):
API Reference
Core Methods
| Method | Description | Parameters | Returns |
|---|---|---|---|
initialize() | Initialize the SDK | projectToken, tokenId, shortLinkDomain, serverUrl?, enableDebugLogging? | Future<String> |
onAppResume() | Handle app resume | None | Future<void> |
onNewURL() | Handle new URL | url: String | Future<void> |
trackAppOpen() | Track app open event | shortLink? | Future<String> |
trackSessionStart() | Track session start | shortLink? | Future<String> |
trackShortLinkClick() | Track link click | shortLink, deepLink? | Future<String> |
getInstallReferrer() | Get stored referrer | None | Future<String> |
fetchInstallReferrer() | Fetch fresh referrer | None | Future<String> |
resetFirstInstall() | Reset install state | None | Future<void> |
Device Fingerprinting Methods
| Method | Description | Parameters | Returns |
|---|---|---|---|
getFingerprint() | Get device fingerprint | None | Future<String> |
getFingerprintId() | Get fingerprint ID | algorithm? | Future<String> |
Event Listeners
| Method | Description | Parameters | Returns |
|---|---|---|---|
addCallbackListener() | Add event listener | callback: (data) => void | StreamSubscription<TrackingCallback> |
callbackStream | Get callback stream | None | Stream<TrackingCallback> |
Dart Types
Testing and Debugging
Test Deep Link Handling
Example Test Scenarios
Debug Logging
Enable debug logging to see detailed SDK activity:Troubleshooting
Common Issues
SDK Not Initialized
SDK Not Initialized
- Check project token and token ID in TryInHouse dashboard
- Verify network connectivity
- Check that initialize() is called before other SDK methods
- Enable debug logging to see detailed error messages
Deep Links Not Working
Deep Links Not Working
- Verify AndroidManifest.xml intent filters are correctly configured - Check iOS URL schemes in Info.plist - Ensure well-known files are properly configured in TryInHouse dashboard - Test with adb command for Android or iOS Simulator for iOS - Verify uni_links package is properly installed
Install Referrer Not Tracked
Install Referrer Not Tracked
- Verify InstallReferrerReceiver is added to AndroidManifest.xml - Test with
Google Play Console’s internal testing - Check that app is installed from Play
Store, not sideloaded - Use
fetchInstallReferrer()to get fresh data - Install referrer only works on Android
Device Fingerprinting Not Working
Device Fingerprinting Not Working
- Device fingerprinting only works on Android
- Check that minimum SDK version is 24 or higher
- Verify app permissions if required
- Test on physical device, not emulator
Platform-Specific Issues
iOS Issues:- Universal links require valid SSL certificate
- Check Associated Domains entitlement
- Verify Team ID in apple-app-site-association file
- Test on device, not simulator for production links
- App links require verified domain
- Check SHA256 fingerprint in assetlinks.json
- Verify intent filters have autoVerify=“true”
- Test with different Android versions
Best Practices
Event Tracking
- Initialize Early: Call
initialize()as soon as possible in your app lifecycle - Handle App Resume: Always call
onAppResume()when the app becomes active - Deep Link Handling: Use
onNewURL()for all incoming deep links on iOS - Error Handling: Wrap SDK calls in try-catch blocks
- Callback Management: Properly dispose of callback listeners
Performance
- Batch Operations: Avoid calling tracking methods in tight loops
- Background Processing: SDK handles background processing automatically
- Network Optimization: SDK batches events for optimal network usage
- Memory Management: Properly dispose of streams and subscriptions
Development Workflow
- Debug Mode: Use debug logging during development
- Testing: Test deep links on both platforms
- Attribution Testing: Use
resetFirstInstall()for testing install attribution - Platform Testing: Test platform-specific features separately
Integration Examples
Navigation Integration
State Management Integration
Next Steps
iOS SDK
Integrate with native iOS apps.
Android SDK
Integrate with native Android apps.
Deep Linking
Set up deep linking for seamless navigation.
Analytics
Understand your analytics data.
Need help with the Flutter SDK? Check our API
documentation or contact
[email protected].