ZendriveInsurance
@interface ZendriveInsurance : NSObject
Applications which want to record Fairmatic insurance periods for a driver may use these APIs.
All drives (automatically detected or manually started) 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 Fairmatic provides via Zendrive
.
Only one period can be active at a time.
Switching periods or calling +stopPeriod:completionHandler:
stops any active drives (automatic or manual).
A drive with multiple insurance periods will be split into multiple trips for different
insurance periods.
-
Deprecated
Start Fairmatic insurance period 1 in the SDK.
Trips in this period will be detected automatically.
Warning
This is deprecated. Please contact Zendrive team if you are an existing Fairmatic customer and you use startPeriod1: API.
Declaration
Objective-C
+ (void)startPeriod1: (nullable ZendriveInsuranceApiCallHandler)completionHandler;
Parameters
completionHandler
A block object to be executed when the task finishes. This block has no return value and two arguments: isSuccess, A boolean that suggests successful completion of the call the error, A valid error of
ZendriveErrorDomain.kZendriveErrorDomain
(ZendriveError
) is returned in case of a failure. Possible error codes returned: kZendriveErrorNotSetup, kZendriveErrorInsurancePeriodSame. Refer toZendriveError
for more details on the errors. -
Start Fairmatic insurance period 1 in the SDK.
A manual trip of id trackingId will be started immediately on this call. The entire duration in this period will be recorded as a single trip. If period 1 is already in progress with the same trackingId, this call will be a no-op.
Declaration
Objective-C
+ (void)startDriveWithPeriod1: (nullable ZendriveInsuranceApiCallHandler)completionHandler;
Parameters
completionHandler
A block object to be executed when the task finishes. This block has no return value and two arguments: isSuccess, A boolean that suggests successful completion of the call the error, A valid error of
ZendriveErrorDomain.kZendriveErrorDomain
(ZendriveError
) is returned in case of a failure. Possible error codes returned:kZendriveErrorNotSetup
,kZendriveErrorInsurancePeriodSame
, Refer toZendriveError
for more details on the errors. -
Start Fairmatic insurance period 2 in the SDK.
A manual trip of id trackingId will be started immediately on this call. The entire duration in this period will be recorded as a single trip. If period 2 is already in progress with the same trackingId, this call will be a no-op.
Declaration
Objective-C
+ (void)startDriveWithPeriod2:(nonnull NSString *)trackingId completionHandler: (nullable ZendriveInsuranceApiCallHandler)completionHandler;
Parameters
trackingId
An identifier which allows identifying this drive uniquely. This drive identifier must be unique for the user.
completionHandler
A block object to be executed when the task finishes. This block has no return value and two arguments: isSuccess, A boolean that suggests successful completion of the call the error, A valid error of
ZendriveErrorDomain.kZendriveErrorDomain
(ZendriveError
) is returned in case of a failure. Possible error codes returned:kZendriveErrorNotSetup
,kZendriveErrorInsurancePeriodSame
,kZendriveErrorInvalidTrackingId
. Refer toZendriveError
for more details on the errors. -
Start Fairmatic insurance period 3 in the SDK.
A manual trip of id trackingId will be started immediately on this call. The entire duration in this period will be recorded as a single trip. If period 3 is already in progress with the same trackingId, this call will be a no-op.
Declaration
Objective-C
+ (void)startDriveWithPeriod3:(nonnull NSString *)trackingId completionHandler: (nullable ZendriveInsuranceApiCallHandler)completionHandler;
Parameters
trackingId
An identifier which allows identifying this drive uniquely. This drive identifier must be unique for the user.
completionHandler
A block object to be executed when the task finishes. This block has no return value and two arguments: isSuccess, A boolean that suggests successful completion of the call the error, A valid error of
ZendriveErrorDomain.kZendriveErrorDomain
(ZendriveError
) is returned in case of a failure. Possible error codes returned:kZendriveErrorNotSetup
,kZendriveErrorInsurancePeriodSame
,kZendriveErrorInvalidTrackingId
. Refer toZendriveError
for more details on the errors. -
Stop currently ongoing Fairmatic insurance period if any.
Ongoing trips at the time of this call will be stopped. Auto trip detection is turned off on this call.
Declaration
Objective-C
+ (void)stopPeriod:(nullable ZendriveInsuranceApiCallHandler)completionHandler;
Parameters
completionHandler
A block object to be executed when the task finishes. This block has no return value and two arguments: isSuccess, A boolean that suggests successful completion of the call the error, A valid error of
ZendriveErrorDomain.kZendriveErrorDomain
(ZendriveError
) is returned in case of a failure. Possible error codes returned:kZendriveErrorNotSetup
. Refer to ZendriveError for more details on the errors.