Before initiating a scan, you must make sure the SCiO device is calibrated. Call the CPScioDevice.isCalibrationValid to verify whether the sensor needs to be calibrated. When calibrating the sensor, the user should put the SCiO into the cover and the app calls the calibrateWithCompletion method.

The calibration data is stored in the device memory of the iOS device and is available until the app is closed.  

The following code sample calibrates a SCiO sensor:

__weak typeof(&*self)weakSelf = self;
 [[CPScioDevice sharedInstance] calibrateWithCompletion:^(BOOL success) {
     NSLog(@"calibration: %i",success);
     
     if (!success) {
         dispatch_async(dispatch_get_main_queue(), ^{
             [weakSelf alertWithTitle:@"Calibration Failed" message:@"Please try again."];
         });
         return;
     }
     [self toastWithTitle:@"Calibration Completed" message:@"You can scan now"];
 }];