Skip to content

RFID Reader

Open RFID Reader

To open the RFID chip reading controller and start its processing, use the method below.

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;
    }
})
[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;
    }
}];

Stop RFID Reader

To stop the RFID chip reading controller programmatically, invoke:

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

Warning

Don't forget to specify the app IDs in the Info.plist file. You can find them here.

RFID Delegate

The RFID chip delegate:

DocReader.shared.rfidDelegate = self
[RGLDocReader shared].rfidDelegate = self;

For information about the methods you can implement for your delegate object, see the following page.

Back to top