Flutter installation
Requirements
Section titled “Requirements”- Flutter 3.24 or later, Dart 3.5 or later
- iOS 15 or later, Android
minSdk23 or higher - The team’s SDK key (
rsk_…) from the form’s Share → Mobile app tab
The plugin supports iOS and Android. It contains the native SDK sources, so you add no native dependency yourself.
Install
Section titled “Install”The package is responsly_sdk. It is not on pub.dev. Add it to pubspec.yaml from the source given in your access details. For a git source the entry looks like this, with <package URL> standing for the URL you received:
dependencies: responsly_sdk: git: url: <package URL> ref: 1.34.0Then run flutter pub get.
Platform minimums
Section titled “Platform minimums”Raise the minimums if your project is below them.
platform :ios, '15.0'android { defaultConfig { minSdk = 23 }}The same lines work in a Groovy android/app/build.gradle.
Initialize
Section titled “Initialize”Call initialize in main, before runApp.
import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';import 'package:responsly_sdk/responsly_sdk.dart';
Future<void> main() async { WidgetsFlutterBinding.ensureInitialized();
await Responsly.initialize( 'rsk_…', options: const ResponslyOptions( logLevel: kDebugMode ? ResponslyLogLevel.debug : ResponslyLogLevel.error, ), );
runApp(const MyApp());}Every method returns Future<void>. You do not have to await them: calls are applied in the order you make them, and calls made before initialize are remembered and applied when the SDK starts.
initialize is idempotent for the same key. Calling it with a different key resets the SDK’s local state first.
Options
Section titled “Options”ResponslyOptions has two fields.
| Field | Values | Notes |
|---|---|---|
logLevel | ResponslyLogLevel.none, .error, .info, .debug | Use debug while integrating. See Testing & debugging. |
apiHost | String | Defaults to https://api.responsly.com. Leave it unset unless Responsly support gives you another host. |
Navigator observer
Section titled “Navigator observer”The plugin adds ResponslyNavigatorObserver, which reports named routes as screens:
MaterialApp( navigatorObservers: [ResponslyNavigatorObserver()], // …);Details are in Track events & screens.