Caliper 1.0 Sensor Library for iOS.

pod try Caliper-iOS


Caliper iOS is a Caliper 1.0 Sensor Library. Written in Swift, it supports both Swift & Objective-C iOS apps.



To add Caliper iOS to your project using CocoaPods, add it to your Podfile:

source ''
platform :ios, '9.0'

target '<Your Target Name>' do
    pod 'Caliper-iOS', '~> 1.0.0'


For Carthage, add it to your Cartfile:

github ""



let options = Options() = "Your Event Store endpoint"
options.apiKey = "Your Event Store API key or authorization token"

let client = Client(options: options)
let sensor = Sensor(identifier: "Your sensor IRI", client: self.client)

let person = Person(identifier: "Your person IRI") = "Your person's name"

let app = SoftwareApplication(identifier: "Your app IRI") = "Your app's name"

let session = Session(identifier: "Your session IRI", actor: person) = "Your session name"
session.startedAtTime = NSDate()
session.dateCreated = NSDate()
session.dateModified = NSDate()

let sessionEvent = SessionEvent(actor: person, action: Action.LOGGED_IN(), object: app, eventTime: NSDate(), generated: session)
sessionEvent.edApp = app

let completion = {
(error: Error?, response: HTTPURLResponse?, data: Data?) -> Void in
    // Do something

sensor.send(data: sessionEvent, completionHandler: completion)


CLSOptions *options = [[CLSOptions alloc] init]; = @"Your Event Store endpoint";
options.apiKey = @"Your Event Store API key or authorization token";

CLSClient *client = [[CLSClient alloc] initWithOptions:self.options];
CLSSensor *sensor = [[CLSSensor alloc] initWithIdentifier:@"Your sensor IRI" client:self.client];

CLSPerson *person = [[CLSPerson alloc] initWithIdentifier:@"Your person IRI"]; = @"Your person's name";

CLSSoftwareApplication *app = [[CLSSoftwareApplication alloc] initWithIdentifier:@"Your app IRI"]; = @"Your app's name";

CLSSession *session = [[CLSSession alloc] initWithIdentifier:@"Your session IRI" actor:person]; = @"Your session name";
session.startedAtTime = [NSDate date];
session.dateCreated = [NSDate date];
session.dateModified = [NSDate date];

CLSSessionEvent *sessionEvent = [[CLSSessionEvent alloc] initWithActor:person action:[CLSAction LOGGED_IN] object:app eventTime:[NSDate date] generated:session];
sessionEvent.edApp = app;

void (^completionBlock)(NSError *, NSHTTPURLResponse*, NSData *) = ^(NSError* error, NSHTTPURLResponse *response, NSData *data){
        // Do something

[self.sensor sendWithData:sessionEvent completionHandler:completionBlock];

If sending data fails (perhaps due to a bad network connection or an expired authorization token), it will be saved to a queue to be sent with the next request.

If the server responds with 400 Bad Request, however, the data will not be added to the queue. In that case, check your usage of the sensor and ensure that you have the correct objects, properties, and values. For help with that, see the Caliper Implementation Guide.


See full documentation here.


Contributing is more than welcome! If you find a bug or run into any problems, please open an issue. If you'd like to contribute code, please submit a pull request.