BlinkID / blinkid-cordova

ID scanning for cross-platform apps built with Cordova and Phonegap.
48 stars 34 forks source link

Change label text "Position ID card in this Frame" #83

Open mladilav opened 5 years ago

mladilav commented 5 years ago

Hello. We use BlinkID 1.5.0v. How do I change the text under the frame? I mean @"Position ID card in this Frame"

jcular commented 5 years ago

Hi @mladilav,

v1.5.0 uses old API and unfortunately changing that text requires writing some native code on iOS. Open CDVBlinkIdScanner.m add the following below #import<MicroBlink/MicroBlink.h>:

@interface CustomIDCardOverlayViewController : PPIDCardOverlayViewController

@end

@implementation CustomIDCardOverlayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.idCardSubview.tooltipLabel.text = @"your text";
}

@end

In the same file replace:

UIViewController<PPScanningViewController> *scanningViewController = [PPViewControllerFactory cameraViewControllerWithDelegate:self coordinator:coordinator error:nil];

with:

CustomIDCardOverlayViewController *idCardOverlay = [[CustomIDCardOverlayViewController alloc] init];
UIViewController<PPScanningViewController> *scanningViewController = [PPViewControllerFactory cameraViewControllerWithDelegate:self overlayViewController:idCardOverlay coordinator:coordinator error:nil];

Kind regards, Jure

mladilav commented 5 years ago

Hi @mladilav,

v1.5.0 uses old API and unfortunately changing that text requires writing some native code on iOS. Open CDVBlinkIdScanner.m add the following below #import<MicroBlink/MicroBlink.h>:

@interface CustomIDCardOverlayViewController : PPIDCardOverlayViewController

@end

@implementation CustomIDCardOverlayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.idCardSubview.tooltipLabel.text = @"your text";
}

@end

In the same file replace:

UIViewController<PPScanningViewController> *scanningViewController = [PPViewControllerFactory cameraViewControllerWithDelegate:self coordinator:coordinator error:nil];

with:

CustomIDCardOverlayViewController *idCardOverlay = [[CustomIDCardOverlayViewController alloc] init];
UIViewController<PPScanningViewController> *scanningViewController = [PPViewControllerFactory cameraViewControllerWithDelegate:self overlayViewController:idCardOverlay coordinator:coordinator error:nil];

Kind regards, Jure

Hello! Thanks for your answer! But I have one more question: Is it possible to get the text @"your text"; from en.strings?

jcular commented 5 years ago

Instead of @"your text" you can set it to MB_LOCALIZED(@"position_tooltip"); and add "position_tooltip" key and it's value inside en.strings file.

Kind regards, Jure

mladilav commented 5 years ago

Hello @jcular !

I have a question. How I can set the language in my app for new microblink (4.7.0) ?

Cerovec commented 4 years ago

Hi @mladilav,

sorry for the delay with the answer. We did, however, check BlinkID v5.3 (our latest release), and the feature to set the language. It seems like for some reason this isn't working in the latest release, so we're classifying this issue as a bug and we will check this before the next release.

Thanks, Jurica.