Fairmatic
Fairmatic class is the entry point into the Leeo SDK. All methods are threadsafe.
Applications which want to record Leeo insurance trips for a driver may use this API. All drives when a period is in progress will be tagged with the period id. This period id will be made available in the reports and API that Leeo provides via Fairmatic.
Only one period may be active at a time. To switch the Leeo insurance period, the application can call the relevant startPeriod method directly. Switching periods or calling stop method stops any active drives. A drive with multiple insurance periods will be split into multiple trips for different insurance periods.
Functions
Configures a custom trip notification provider for dynamic notification customization.
Returns an identifier which can be used to identify this SDK build.
Get the current state of settings affecting the Leeo SDK's normal operation. This method returns a com.fairmatic.sdk.classes.FairmaticSettingError object that contains a list of errors and warnings that are affecting Fairmatic's ability to detect trips and perform other tasks.
Retrieves the URL of the incident reporting web page.
Initialize the Leeo SDK only if the com.drivekit.sdk.auto_init_enabled flag is set to false This method should be called in the onCreate() method of the application class.
Opens the incident reporting web page in the device's default browser.
Setup the Leeo SDK with a configuration. The application should call this method before anything else in the Leeo SDK. This API should should be called in onCreate() method of application class. If you don't have an application class, you should create one and specify it in your AndroidManifest.xml file. Calling this method multiple times with the same 'sdkKey' and 'driverId' in the com.fairmatic.sdk.classes.FairmaticConfiguration is a no-op. Once setup finishes, the com.fairmatic.sdk.classes.FairmaticOperationCallback is called (if provided) with the result of the setup operation. Callback is made on the Main Thread.
Call this method once the driver waits for a new ride or delivery request A manual trip with the given trackingId will be started immediately. If this is already in progress with the same trackingId, this call will be a no-op.
Call this method once the driver accepts the ride or delivery request A manual trip with the given trackingId will be started immediately. If this is already in progress with the same trackingId, this call will be a no-op.
Call this method once the driver starts the ride or delivery A manual trip with the given trackingId will be started immediately. The entire duration in this period will be recorded as a single trip. If this is already in progress with the same trackingId, this call will be a no-op.
Call this method once the driver completes the ride or delivery Ongoing trips will be stopped.
Shuts down the Fairmatic framework. This may be called if the client wishes to turn off the Fairmatic framework to isolate the operations that the application is doing. This is a no-op if setup has not been called. Once teardown finishes, the com.fairmatic.sdk.classes.FairmaticOperationCallback is called (if provided) with the result of the teardown operation. Callback is made on the Main Thread.
Wipe out all the data that fairmatic keeps locally on the device. When Fairmatic SDK is torn down, trip data that is locally persisted continues to remain persisted. The data will be uploaded when SDK setup is called at a later time. Wipeout should be used when the application wants to remove all traces of Fairmatic on the device. Data cannot be recovered after this call. NOTE: This call can be made when the SDK is not running. Call teardown to tear down a live SDK before making this call.**