-
Notifications
You must be signed in to change notification settings - Fork 3
Using MyKad recognizer
MyKad recognizer is responsible for scanning, decoding and parsing front side of Malaysian ID documents MyKads
If you completed Obtaining scanning results guide, you learned that in order to use a specific recognizer, you need to specify Recognizer Settings object in the initialization stage, and collect Recognizer Result object in the success callback.
Here we explain how to use MyKad recognizer, it's settings class PPMyKadRecognizerSettings
, and result class PPMyKadRecognizerResult
to obtain Driver's license information from the scanning results.
Back to "Getting started" guide.
Below is the sample source code which initializes the scanning for Malaysian ID documents.
// 3. ************* Setup Scan Settings **************/
// To specify we want to perform MyKad (Malysian ID document) recognition, initialize the MyKad recognizer settings
PPMyKadRecognizerSettings *mykadRecognizerSettings = [[PPMyKadRecognizerSettings alloc] init];
// Add MyKad Recognizer setting to a list of used recognizer settings
[settings.scanSettings addRecognizerSettings:mykadRecognizerSettings];
By default, scanningViewController:didOutputResults:
callback returns results as a PPRecognizerResults
object. When the instance of this result is of type PPMyKadRecognizerResult
, this means we got the result of MyKad scanning and parsing.
Below is the sample source code which demonstrates how to collect results of MyKad scanning.
- (void)scanningViewController:(UIViewController<PPScanningViewController> *)scanningViewController
didOutputResults:(NSArray<PPRecognizerResult *> *)results {
// Here you process scanning results. Scanning results are given in the array of PPRecognizerResult objects.
// first, pause scanning until we process all the results
[scanningViewController pauseScanning];
// Collect data from the result
for (PPRecognizerResult* result in results) {
// Check if result is MyKad result
if ([result isKindOfClass:[PPMyKadRecognizerResult class]]) {
// Cast result to PPMyKadRecognizerResult
PPMyKadRecognizerResult *myKadResult = (PPMyKadRecognizerResult *)result;
// For accessing owner full name, use property ownerFullName
NSLog(@"Full name: %@", myKadResult.ownerFullName);
// For accessing NRIC number, use property nricNumber
NSLog(@"NRIC no.: %@", myKadResult.nricNumber);
// For accessing owner address, use property ownerAddress
NSLog(@"Address: %@", myKadResult.ownerAddress);
// For accessing Birth date, use property ownerBirthDate
NSLog(@"Birth date: %@", myKadResult.ownerBirthDate);
// For accessing Religion, use property ownerReligion
NSLog(@"Religion: %@", myKadResult.ownerReligion);
// For accessing owner sex, use property ownerSex
NSLog(@"Sex: %@", myKadResult.ownerSex);
}
};
// either resume scanning, or dismiss Scanning View controller
// [scanningViewController resumeScanningAndResetState:YES];
[scanningViewController dismissViewControllerAnimated:YES completion:nil];
}
- Getting Started with PhotoPay SDK
-
Obtaining scanning results
- Scanning Austrian payslips
- Scanning Belgian payslips
- Scanning Croatian HUB payslips / barcodes
- Scanning Dutch Acceptgiros
- Scanning German payslips
- Scanning Hungarian payslips
- Scanning SEPA payment QR codes
- Scanning Slovenian payslips
- Using BlinkID recognizers
- Using MRTD Recognizer for scanning ID documents
- Using EUDL Recognizer
- Using USDL Recognizer
- Using MyKad recognizer
- Using PDF417 Recognizer
- Using BarDecoder Recognizer
- Using ZXing Recognizer
- Using Barcode Recognizer
- Using Templating API
- Using Detector Recognizer
- Using BlinkInput OCR Recognizer
- Troubleshoot
- Using Direct Processing API
- Customizing Camera UI
- Creating customized framework
- Upgrading from older versions