RFID reader

Use the method below to open RFID chip reading controller and start its processing:

Swift
Objective-C
Swift
DocReader.shared.startRFIDReader(fromPresenter: self, completion: { (action, results, error) in
switch action {
case .complete:
print("Completed")
case .cancel:
print("Cancelled by user")
case .error:
print("Error: \(error)")
default:
break;
}
})
Objective-C
[RGLDocReader.shared startRFIDReaderFromPresenter:self completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
switch (action) {
case RGLDocReaderActionComplete: {
NSLog(@"Completed");
}
break;
case RGLDocReaderActionCancel: {
NSLog(@"Cancelled by user");
}
break;
case RGLDocReaderActionError: {
NSLog(@"Error: %@", error);
}
break;
default:
break;
}
}];

Use the method below to stop RFID chip reading programmatically:

Swift
Objective-C
Swift
DocReader.shared.stopRFIDReader {
print("Stopped")
}
Objective-C
[RGLDocReader.shared stopRFIDReader:^{
NSLog(@"Stopped");
}];

Don't forget to specify the app IDs in the Info.plist file. They can be found here.