Skip to main content

Notifications

All NSNotification constants provided by the Aila SDK.

Overview

The SDK posts notifications to the default NSNotificationCenter for various events. Subscribe to these notifications to react to hardware changes, scan events, and other system events.

AilaMobileImagerStateChangedNotification

Posted when the scanning state is changed by depressing the dedicated scan buttons on Aila's Mobile Imager.

Aila_Start() and Aila_Stop() do not trigger this notification.

extern NSString *const AilaMobileImagerStateChangedNotification;

userInfo Dictionary:

KeyValue
state@YES if scanning started, @NO if stopped

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleImagerStateChanged:)
name:AilaMobileImagerStateChangedNotification
object:nil];

- (void)handleImagerStateChanged:(NSNotification *)notification {
BOOL isScanning = [notification.userInfo[@"state"] boolValue];
NSLog(@"Scanning state: %@", isScanning ? @"Started" : @"Stopped");
}

AilaHardwareChangedNotification

Posted when a change in system configuration is detected (e.g., hardware connected or disconnected).

extern NSString *const AilaHardwareChangedNotification;

userInfo Dictionary:

KeyValue
hardwareClass[NSNumber numberWithInt:Aila_GetHardwareClass()]

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleHardwareChanged:)
name:AilaHardwareChangedNotification
object:nil];

- (void)handleHardwareChanged:(NSNotification *)notification {
AilaHardwareClass hardwareClass = [notification.userInfo[@"hardwareClass"] intValue];
NSLog(@"Hardware changed: %d", hardwareClass);
}

AilaID1CardDetectedNotification

Posted when a card is detected in the tray (when id1CardDetectionMode is enabled).

extern NSString *const AilaID1CardDetectedNotification;

userInfo Dictionary: nil

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleCardDetected:)
name:AilaID1CardDetectedNotification
object:nil];

- (void)handleCardDetected:(NSNotification *)notification {
NSLog(@"Card detected in tray");
// Trigger image capture
Aila_ID1CaptureImage(^(UIImage *image, NSError *error) {
// Handle captured image
});
}

AilaMRZDetectedNotification

Posted when MRZ components are detected in the camera feed (when mrzDetectionMode is enabled).

This provides early indication that an MRZ document is present, before complete scanning occurs. The notification fires when the SDK detects any MRZ components such as document numbers, birth dates, expiry dates, or personal identification numbers.

extern NSString *const AilaMRZDetectedNotification;

userInfo Dictionary: nil

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMRZDetected:)
name:AilaMRZDetectedNotification
object:nil];

- (void)handleMRZDetected:(NSNotification *)notification {
NSLog(@"MRZ document detected");
// Update UI to guide user
}

AilaFirmwareNotification

Posted when an attempt at a firmware update is started or finished.

extern NSString *const AilaFirmwareNotification;

userInfo Dictionary:

KeyValue
firmwareStatusBOOL

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleFirmwareUpdate:)
name:AilaFirmwareNotification
object:nil];

- (void)handleFirmwareUpdate:(NSNotification *)notification {
BOOL status = [notification.userInfo[@"firmwareStatus"] boolValue];
NSLog(@"Firmware update status: %@", status ? @"Success" : @"Failed");
}

AilaSetCodesNotification

Posted when there is an internal setting or checking of enabled barcodes.

extern NSString *const AilaSetCodesNotification;

userInfo Dictionary: nil

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleSetCodes:)
name:AilaSetCodesNotification
object:nil];

- (void)handleSetCodes:(NSNotification *)notification {
NSLog(@"Barcode configuration changed");
}

AilaSetLicenseNotification

Posted when there are internal or cloud-based changes to the SDK licensing.

extern NSString *const AilaSetLicenseNotification;

userInfo Dictionary: nil

Usage:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleLicenseChanged:)
name:AilaSetLicenseNotification
object:nil];

- (void)handleLicenseChanged:(NSNotification *)notification {
NSLog(@"License configuration changed");
// Optionally refresh license info
NSString *info = Aila_GetSDKLicensingInfo();
}

See Also