Skip to content

Commit

Permalink
Don't show notification on macOS 12 (open-eid#30)
Browse files Browse the repository at this point in the history
It is already shown in Pin Dialog

IB-7235

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Apr 14, 2022
1 parent 405b99e commit 4349f73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions EstEIDToken/TokenSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ - (BOOL)isAllDigits:(NSString*)data {
return r.location == NSNotFound && data.length > 0;
}

- (nullable instancetype)initWithSmartCard:(TKSmartCard *)smartCard tokenSession:(TokenSession *)esteidsession {
- (nullable instancetype)initWithSmartCard:(TKSmartCard *)smartCard tokenSession:(TokenSession *)eidsession {
if (self = [super init]) {
self.smartCard = smartCard;
[esteidsession pinPadTemplate:self];
session = esteidsession;
[eidsession pinPadTemplate:self];
session = eidsession;
}
return self;
}
Expand All @@ -64,7 +64,13 @@ - (BOOL)finishWithError:(NSError **)error {
if ((sw & 0xff00) == 0x6300 || sw == 0x6983) {
int triesLeft = sw == 0x6983 ? 0 : sw & 0x3f;
NSLog(@"EstEIDAuthOperation finishWithError Failed to verify PIN sw:0x%04x retries: %d", sw, triesLeft);
[EstEIDTokenDriver showNotification:[NSString localizedStringWithFormat:NSLocalizedString(@"VERIFY_TRY_LEFT", nil), triesLeft]];
if (@available(macOS 12, *)) {
if (triesLeft == 0) {
[EstEIDTokenDriver showNotification:[NSString localizedStringWithFormat:NSLocalizedString(@"VERIFY_TRY_LEFT", nil), triesLeft]];
}
} else {
[EstEIDTokenDriver showNotification:[NSString localizedStringWithFormat:NSLocalizedString(@"VERIFY_TRY_LEFT", nil), triesLeft]];
}
if (triesLeft == 0) {
[session closeSession];
}
Expand Down
4 changes: 2 additions & 2 deletions EstEIDTokenApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
Expand Down Expand Up @@ -562,7 +562,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
OTHER_CODE_SIGN_FLAGS = "--timestamp --options=runtime";
SDKROOT = macosx;
};
Expand Down

0 comments on commit 4349f73

Please sign in to comment.