TchekSDK Documentation

Class Tchek​Sdk

public class TchekSdk  

This class is the entry point to the Tchek™ SDK

Properties

VERSION

public static var VERSION: String  

Methods

configure(key:​builder:​on​Completion:​)

public static func configure(key: String,
								 builder: TchekBuilder,
								 onCompletion: @escaping () -> Void)  

Initializes the Tchek™ SDK with the provided key and TchekBuilder

Usage:

let builder = TchekBuilder { builder in
builder...
}
	 
TchekSdk.configure(key: "my-tchek-sdk-key", builder: builder)
	 
// SDK is initialized, you can start using it!

Parameters

key String

The Tchek™ SDK key (mandatory)

on​Completion @escaping () -> Void

Block called when the configure is ready

builder Tchek​Builder

The builder to customize the global look of the SDK UI

Important

It is mandatory to call this method at least once before using the Tchek™ SDK.

configure(key​SSO:​builder:​on​Failure:​on​Success:​)

public static func configure(keySSO: String,
								 builder: TchekBuilder,
								 onFailure: @escaping (TchekError) -> Void,
								 onSuccess: @escaping (TchekSSO) -> Void)  

Initializes the Tchek™ SDK with the provided key and TchekBuilder

Usage:

let builder = TchekBuilder { builder in
builder...
}
	 
TchekSdk.configure(keySSO: "my-tchek-sdk-sso-key", onCompletion: {}, builder: builder)
	 
// SDK is initialized, you can start using it!

Parameters

key​SSO String

The Tchek™ SDK SSO key (mandatory)

on​Failure @escaping (Tchek​Error) -> Void

Block called when error occurs

on​Success @escaping (Tchek​SSO) -> Void

Block called when the configure is ready with the TchekSSO Object

builder Tchek​Builder

The builder to customize the global look of the SDK UI

Important

It is mandatory to call this method at least once before using the Tchek™ SDK.

load​All​Tchek(type:​device​Id:​search:​limit:​page:​on​Failure:​on​Success:​)

public static func loadAllTchek(type: TchekScanType?,
									deviceId: String?,
									search: String?,
									limit: Int,
									page: Int,
									onFailure: @escaping (TchekError) -> Void,
									onSuccess: @escaping ([TchekScanLite]) -> Void)  

This method load all tchek

Parameters

type Tchek​Scan​Type?

The type between Mobile or Device in enum TchekScanType. Pass null for all types

device​Id String?

The TchekDevice id you want to load. Ignored if type is Mobile

search String?

The license plate to search

limit Int

The int indicates the number of tchek to load. Min 50 - Max 250

page Int

The int indicate the page to load

on​Failure @escaping (Tchek​Error) -> Void

Block called if an error occurs during loading

on​Success @escaping ([Tchek​Scan​Lite]) -> Void

Block called when the list of tchek is ready

get​Report​Url(tchek​Id:​validity:​cost:​on​Failure:​on​Success:​)

public static func getReportUrl(tchekId: String,
									validity: Int?,
									cost: Bool,
									onFailure: @escaping (TchekError) -> Void,
									onSuccess: @escaping (String) -> Void)  

This method get report url for a Tchek

Parameters

tchek​Id String

The TchekScan id you want to load

validity Int?

The url validity in days. Can be null => infinite

cost Bool

The boolean indicates that the costs are displayed in the report

on​Failure @escaping (Tchek​Error) -> Void

Block called if an error occurs during loading

on​Success @escaping (String) -> Void

Block called when the report url is ready

shoot​Inspect(builder:​)

public static func shootInspect(builder: TchekShootInspectBuilder) -> UIViewController  

This method initializes a Shoot/Inspect flow customized with the provided TchekShootInspectBuilder

Usage:

let builder = TchekShootInspectBuilder(delegate: self) { builder in
builder...
}
	 
let viewController = TchekSdk.shootInspect(builder: builder)
	 
// Display the Shoot/Inspect UIViewController
navigationController.pushViewController(viewController, animated: true)

Parameters

builder Tchek​Shoot​Inspect​Builder

The builder to customize the look of Shoot/Inspect UI elements

Returns

A UIViewController to initiate the Shoot/Inspect flow

shoot​Inspect​End(tchek​Id:​builder:​)

public static func shootInspectEnd(tchekId: String, builder: TchekShootInspectBuilder) -> UIViewController  

This method initializes a Shoot/Inspect flow customized with the provided TchekShootInspectBuilder and directly go to the end oh Shoot Inspect to launch a detection

Usage:

let builder = TchekShootInspectBuilder(delegate: self) { builder in
builder...
}
	 
let viewController = TchekSdk.shootInspectEnd(tchekId: "any-tchek-id", builder: builder)
	 
// Display the Shoot/Inspect UIViewController
navigationController.pushViewController(viewController, animated: true)

Parameters

tchek​Id String

Id of the Tchek the Shoot Inspect launch a detection

builder Tchek​Shoot​Inspect​Builder

The builder to customize the look of Shoot/Inspect UI elements

Returns

A UIViewController to initiate the Shoot/Inspect flow

fast​Track(builder:​)

public static func fastTrack(builder: TchekFastTrackBuilder) -> UIViewController  

This method initializes a FastTrack flow customized with the provided TchekFastTrackBuilder

Usage:

let builder = TchekFastTrackBuilder(delegate: self) { builder in
builder...
}
	 
let viewController = TchekSdk.fastTrack(builder: builder)
	 
// Display the FastTrack UIViewController
navigationController.pushViewController(viewController, animated: true)

Parameters

builder Tchek​Fast​Track​Builder

The builder to customize the look FastTrack UI elements

Returns

A UIViewController to initiate the FastTrack flow

report(builder:​)

public static func report(builder: TchekReportBuilder) -> UIViewController  

This method initializes a report screen customized with the provided TchekReportBuilder

Usage:

let builder = TchekReportBuilder(delegate: self) { builder in
builder.btnReportPrevColor = .lightGray
builder.btnReportPrevTextColor = .darkGray
builder.btnReportNextColor = .black
builder.btnReportNextTextColor = .white
builder.reportPagingBg = .orange
builder.reportPagingText = .lightText
builder.reportPagingTextSelected = .white
builder.reportPagingIndicator = .white
}
	 
let viewController = TchekSdk.report(builder: builder)
	 
// Display the report UIViewController
navigationController.pushViewController(viewController, animated: true)

Parameters

builder Tchek​Report​Builder

The builder to customize the look of report UI elements

Returns

A UIViewController to initiate the report screen

delete​Tchek(tchek​Id:​on​Failure:​on​Success:​)

public static func deleteTchek(tchekId: String,
								   onFailure: @escaping () -> Void,
								   onSuccess: @escaping () -> Void)  

This method delete a tchek

Parameters

tchek​Id String

Id of the Tchek to delete

buy​Back​Manager()

public static func buyBackManager() -> TchekBuyBackManager  

socket​Manager(type:​device:​)

public static func socketManager(type: TchekScanType, device: TchekDevice?) -> TchekSocketManager?  

This method initialize a new Socket manager

Parameters

type Tchek​Scan​Type

The type between Mobile or Device in enum TchekScanType

device Tchek​Device?

The TchekDevice you want to load. Ignored if type is Mobile