FairmaticConfiguration

class FairmaticConfiguration(var sdkKey: String, val driverId: String, val driverAttributes: FairmaticDriverAttributes)

The configuration to pass to Fairmatic for com.fairmatic.sdk.Fairmatic.setup. It contains properties like the sdk key, driver id, driver attributes etc.

Parameters

sdkKey
  • The Fairmatic sdk key for this application.

driverId
  • Each driver using the application needs a unique Id. This same Id will be used in Fairmatic driver analytics services like the dashboard and API. The driver Id may be upto 64 characters long. Additionally, the driver Id needs to be websafe. You can use com.fairmatic.sdk.Fairmatic.isValidInputParameter to validate the driver Id. Passing an invalid id will cause the Fairmatic SDK setup to fail. This cannot be null.The driver id for this driver. This cannot be null.

Throws: NullPointerException - if sdkKey or driverId is null.

Constructors

Link copied to clipboard
constructor(sdkKey: String, driverId: String, driveDetectionMode: FairmaticDriveDetectionMode, driverAttributes: FairmaticDriverAttributes)

Creates a FairmaticConfiguration with the given sdk key, driver id and drive detection mode.

constructor(sdkKey: String, driverId: String, driverAttributes: FairmaticDriverAttributes)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the drive detection mode specified for the Fairmatic SDK.

Link copied to clipboard

Returns a boolean indicating if the app supports receiving multiple callbacks.

Link copied to clipboard

Set the drive detection mode of this configuration.

Link copied to clipboard
fun setImplementsMultipleAccidentCallbacks(implementsMultipleAccidentCallbacks: Boolean)

Set this property to true if the app supports receiving multiple callbacks. If set to true, the application will receive FairmaticBroadcastReceiver.onPotentialAccident. This callback can serve as an early indication of a collision that might have happened. A potential accident event sent this way might be invalidated by the final callback in FairmaticBroadcastReceiver.onAccident. Such a callback will have AccidentInfo.confidenceNumber set to 0 and AccidentInfo.confidence set to FairmaticAccidentConfidence.INVALID.

Link copied to clipboard

Return the json representation of this object. Null if a json exception occurred.