FitLive Developer Documentation

Quick start

This document introduces the FitLive IOS SDK. The FitLive IOS SDK allows developers to build IOS augmented reality virtual eyewear fitting applications based on FittingBox technology.

The FitLive IOS SDK provides an API and its associated library, code samples, and documentation.

SDK Content

The FitLive IOS API has been designed as an IOS framework in order to support simple and standard integration in XCode project.

It contains:

Compatibility

The API is compatible with SDK iOS 7.1(or higher) and supports the armv7 architecture.

Integration

1. FitLiveAPIDelegate protocol assignement

[FitLiveAPI sharedInstance].delegate = self;
The FitLiveAPIDelegate protocol defines the basic methods to handle the errors and global events.

* See Delegate API reference for more details.

2. Start the trying on with the camera device

[[FitLiveAPI sharedInstance] startWithCamera:FitLive::E_CAMERA_FRONT andWindow:window andViewController:self 
                                     andView:self.tryOnView];
* See API reference for more details.

3. Set glasses to tryon

[[FitLiveAPI sharedInstance] loadGlassesWithPath:@"pathToDataFile.bin" 
                                      andWithSku:@SKU_NUMBER" andWithKey:@"KeyFromGetData"];

Basic full example

Integration

@implementation FitLiveAPIDemoViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIWindow* window = [[[UIApplication sharedApplication] delegate] window];
    
    // -------- FitLiveAPI --------
    
    // register the delegate
    [FitLiveAPI sharedInstance].delegate = self;
    
    // start
    [[FitLiveAPI sharedInstance] startWithCamera:FitLive::E_CAMERA_FRONT 
                                       andWindow:window 
                               andViewController:self 
                                         andView:self.tryOnView];
    // get the path for the ressource
    NSString *pathFile =  [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] bundlePath],
                                                               @"CK_CK3151S-S-001-55-16-130.bin"];
    // load default glasses
    [[FitLiveAPI sharedInstance] loadGlassesWithPath:pathFile 
                                          andWithSku:@"CK_CK3151S-S-001-55-16-130" 
                                          andWithKey:@"0030032EFF90... ..0FB033C4E7B96E592335"];
    
}