Find the Quick Start Guide in our GitHub repo.
With Flutter:
TerminalCopyflutter pub add avo_inspector
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
yamlCopy12dependencies:avo_inspector: ^0.9.9
Now in your Dart code, you can use:
dartCopy1import 'package:avo_inspector/avo_inspector.dart';
Obtain the API key in Inspector tab in your Avo.app workspace.
You will need to create an instance of AvoInspector with the constructor:
dartCopy12345AvoInspector avoInspector = await AvoInspector.create(apiKey: "my_key",env: AvoInspectorEnv.dev,appVersion: "1.0",appName: "Hello Flutter");
Parameters:
apiKey
- the API key you get in Inspector Setup Guide in your Avo Workspaceenv
- current environment:AvoInspectorEnv.dev
,AvoInspectorEnv.staging
orAvoInspectorEnv.prod
appVersion
- your application version. Some Inspector features rely on versioning and you need to provide a comparable string here to get value from them. We recommend using semantic versioning or integers that are incremented in every release.appName
- your application name. Optional; Provide it to make it easier to distinguish between data from different apps.
This method gets the actual tracking event parameters, extracts the schema automatically and sends it to Avo Inspector backend. Just call this method at the same place you call your analytics tools' track methods with the same parameters.
dartCopy123456avoInspector.trackSchemaFromEvent(eventName: "Event name",eventProperties: {"String Prop": "Prop Value","Float Prop": 1.0,"Boolean Prop": true});
Parameters:
eventName
- string event name, also known as event type.eventProperties
- The actual event properties, which will be converted to an event schema on the device and the event schema will be sent to Avo. The resulting keys will be object field names and the values will be object field value types converted to schema types.
Logs are enabled by default in the dev mode and disabled in prod and staging modes.
dartCopy1AvoInspector.shouldLog = true;
Parameters:
shouldLog
- boolean flag that sets whether Avo Inspector SDK will print logs
In order to ensure our SDK doesn't have a large impact on performance or battery life it supports event schemas batching.
Default batch size is 30 and default batch flush timeout is 30 seconds. In development mode batching is disabled.
dartCopy1AvoBatcher.batchSizeThreshold = 10;
dartCopy1AvoBatcher.batchFlushSecondsThreshold = 10;