Address Verification SDKs
This page provides documentation for address verification SDKs available for different platforms.
Flutter SDK
A Flutter plugin for real-time address verification with background location tracking capabilities.
Features
- Real-time address validation
- Background location tracking
- Configuration management
- Cross-platform support (Android & iOS)
Installation
Add to your pubspec.yaml
:
Platform Setup
Android
Add these permissions to android/app/src/main/AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Inside your
<application
android:name="${applicationName}"
android:label="YourAppName"
tools:replace="android:label,android:name">
...
</application>
Ensure your build.gradle
has:
iOS
Add these to your ios/Runner/Info.plist
:
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs location access to verify your address</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs continuous location access for address verification</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>processing</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>tech.sourceid.addressverification.geotag</string>
</array>
Minimum iOS version: 15.0
Usage
Basic Implementation
import 'package:sid_address_verification/sid_address_verification.dart';
// Initialize tracking
void startTracking() async {
try {
final success = await SidAddressVerification.startTrackingWithConfig(
"your_api_key",
"user_access_token",
"user_refresh_token",
);
if (success) {
print('Tracking started successfully');
}
} catch (e) {
print('Error starting tracking: $e');
}
}
// Stop tracking
void stopTracking() async {
try {
await SidAddressVerification.stopTracking();
print('Tracking stopped');
} catch (e) {
print('Error stopping tracking: $e');
}
}
// Fetch configuration
void fetchConfig() async {
try {
final config = await SidAddressVerification.fetchConfiguration("your_api_key");
print('Configuration: $config');
} catch (e) {
print('Error fetching config: $e');
}
}
Full Example App
See the complete example implementation in the example folder.
API Reference
Methods
Method | Description | Parameters |
---|---|---|
startTrackingWithConfig |
Starts background tracking | apiKey , token , refreshToken |
stopTracking |
Stops active tracking | - |
fetchConfiguration |
Gets current configuration | apiKey |
getPlatformVersion |
Gets device OS version | - |
Events
Listen for location updates:
SidAddressVerification.addLocationListener((location) {
print('New location: ${location['latitude']}, ${location['longitude']}');
});
Configuration
Android Dependencies
The plugin requires these dependencies:
// Location Services
implementation("com.google.android.gms:play-services-location:21.0.1")
// Lifecycle
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0") // or converter-moshi, etc.
implementation("com.squareup.okhttp3:okhttp:4.10.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
iOS Requirements
- Ensure background modes are enabled in Xcode
- Add required privacy descriptions
Troubleshooting
Common Issues
Issue | Solution |
---|---|
Missing permissions | Verify all permissions are declared |
Background tasks not working | Check background modes in Xcode |
Build errors | Run flutter clean and pod install --repo-update |
Error Messages
Error | Solution |
---|---|
"MissingPluginException" |
Ensure proper plugin registration |
"Location permissions denied" |
Check manifest/plist permissions |
"Background task failed" |
Verify background mode configuration |
React Native SDK
Coming Soon
The React Native SDK for address verification is currently under development and will be available soon. This SDK will provide similar functionality to the Flutter SDK, including:
- Real-time address validation
- Background location tracking
- Cross-platform support (Android & iOS)
- Easy integration with React Native applications
Stay tuned for updates!
License
MIT License - See LICENSE for details.