This is a quick start guide. For more information about Inspector project please read Avo documentation.
This is the Swift Package Manager repo, you can also use Inspector via CocoaPods
To use this package search for this repo url https://github.com/avohq/ios-avo-inspector-spm in Xcode
Obj-C
#import <AvoInspector.h>
Swift
import AvoInspector
Obtain the API key at Avo.app
Obj-C
AvoInspector *avoInspector = [[AvoInspector alloc] initWithApiKey:@"apiKey" env: AvoInspectorEnvDev];
Swift
let avoInspector = AvoInspector(apiKey: "apiKey", env: AvoInspectorEnv.dev)
Logs are enabled by default in the dev mode and disabled in prod mode based on the init flag.
Obj-C
[AvoInspector setLogging:YES];
Swift
AvoInspector.setLogging(true)
The setup is lightweight and is covered in this guide.
Every event sent with Codegen after this integration will automatically be sent to Inspector.
Whenever you send tracking event call one of the following methods:
Read more in the Avo documentation
This methods get actual tracking event parameters, extract schema automatically and send it to Inspector backend. It is the easiest way to use the library, just call this method at the same place you call your analytics tools' track methods with the same parameters.
Obj-C
[avoInspector trackSchemaFromEvent:@"Event Name" eventParams:@{@"id": @"sdf-334fsg-334f", @"number": @41}];
Swift
avoInspector.trackSchema(fromEvent: "Event Name", eventParams: ["id": "sdf-334fsg-334f", "number": 41])
If you prefer to extract data schema manually you would use this method.
Obj-C
[avoInspector trackSchema:@"Event Name" eventSchema:@{@"id": [[AvoString alloc] init], @"number": [[AvoInt alloc] init]}];
Swift
avoInspector.trackSchema("Event Name", eventSchema: ["id": AvoString(), "number": AvoInt()])
Obj-C
NSDictionary * schema = [avoInspector extractSchema:@{@"id": @"sdf-334fsg-334f", @"number": @41}];
Swift
let schema = avoInspector.extractSchema(["id": "sdf-334fsg-334f", "number": 41])
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 debug mode default batch flush timeout is 1 second, i.e. the SDK batches schemas of events sent withing one second.
Obj-C
[AvoInspector setBatchSize:15];
[AvoInspector setBatchFlushSeconds:10];
Swift
AvoInspector.setBatchSize(15)
AvoInspector.setBatchFlushSeconds(10)
TBD
Avo (https://www.avo.app), [email protected]
AvoInspector is available under the MIT license. See the LICENSE file for more info.