Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Sources/NFCCardReaderProvider/NFCHealthCardSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public class NFCHealthCardSession<Output>: NSObject, NFCTagReaderSessionDelegate
return
} catch HealthCardControl.KeyAgreement.Error.macPcdVerificationFailedOnCard {
safeResumeContinuation(with: .failure(NFCHealthCardSessionError.wrongCAN))
session.invalidate(errorMessage: messages.noCardMessage)
session.invalidate(errorMessage: messages.wrongCardAccessNumberMessage ?? messages.noCardMessage)
return
} catch {
safeResumeContinuation(with: .failure(NFCHealthCardSessionError.establishingSecureChannel(error)))
Expand Down Expand Up @@ -377,6 +377,10 @@ extension NFCHealthCardSession {
public let connectMessage: String
/// The message during establishing a secure card channel after the connect
public let secureChannelMessage: String
/// The message when an incorrect Card Access Number (CAN) was entered.
/// Falls back to `noCardMessage` if not provided.
// TO-DO: Make non-optional (String) in next breaking change (major version bump)
public let wrongCardAccessNumberMessage: String?
/// The message when 'something else' as a card is found, but not a card
public let noCardMessage: String
/// The message to display when multiple NFC Cards were detected
Expand All @@ -392,6 +396,8 @@ extension NFCHealthCardSession {
/// - discoveryMessage: The message that is being displayed when polling for a NFC Card
/// - connectMessage: The message when the card is being initialized for downstream usage
/// - secureChannelMessage: The message during establishing a secure card channel after the connect
/// - wrongCardAccessNumberMessage: The message when an incorrect Card Access Number (CAN) was entered.
/// Optional; defaults to nil (will use `noCardMessage` as fallback).
/// - noCardMessage: The message when 'something else' as a card is found, but not a card
/// - multipleCardsMessage: The message to display when multiple NFC Cards were detected
/// - unsupportedCardMessage: The message when the card type is unsupported
Expand All @@ -400,6 +406,7 @@ extension NFCHealthCardSession {
discoveryMessage: String,
connectMessage: String,
secureChannelMessage: String,
wrongCardAccessNumberMessage: String? = nil,
noCardMessage: String,
multipleCardsMessage: String,
unsupportedCardMessage: String,
Expand All @@ -408,6 +415,7 @@ extension NFCHealthCardSession {
self.discoveryMessage = discoveryMessage
self.connectMessage = connectMessage
self.secureChannelMessage = secureChannelMessage
self.wrongCardAccessNumberMessage = wrongCardAccessNumberMessage
self.noCardMessage = noCardMessage
self.multipleCardsMessage = multipleCardsMessage
self.unsupportedCardMessage = unsupportedCardMessage
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/NFC/NFCChangeReferenceDataController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class NFCChangeReferenceDataController: ChangeReferenceData {
discoveryMessage: NSLocalizedString("nfc_txt_discoveryMessage", comment: ""),
connectMessage: NSLocalizedString("nfc_txt_connectMessage", comment: ""),
secureChannelMessage: NSLocalizedString("nfc_txt_secureChannel", comment: ""),
wrongCardAccessNumberMessage: NSLocalizedString("nfc_txt_wrongCANMessage", comment: ""),
noCardMessage: NSLocalizedString("nfc_txt_noCardMessage", comment: ""),
multipleCardsMessage: NSLocalizedString("nfc_txt_multipleCardsMessage", comment: ""),
unsupportedCardMessage: NSLocalizedString("nfc_txt_unsupportedCardMessage", comment: ""),
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/NFC/NFCReadPersonalDataController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class NFCReadPersonalDataController: ReadPersonalData {
discoveryMessage: NSLocalizedString("nfc_txt_discoveryMessage", comment: ""),
connectMessage: NSLocalizedString("nfc_txt_connectMessage", comment: ""),
secureChannelMessage: NSLocalizedString("nfc_txt_secureChannel", comment: ""),
wrongCardAccessNumberMessage: NSLocalizedString("nfc_txt_wrongCANMessage", comment: ""),
noCardMessage: NSLocalizedString("nfc_txt_noCardMessage", comment: ""),
multipleCardsMessage: NSLocalizedString("nfc_txt_multipleCardsMessage", comment: ""),
unsupportedCardMessage: NSLocalizedString("nfc_txt_unsupportedCardMessage", comment: ""),
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/NFC/NFCResetRetryCounterController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class NFCResetRetryCounterController: ResetRetryCounter {
discoveryMessage: NSLocalizedString("nfc_txt_discoveryMessage", comment: ""),
connectMessage: NSLocalizedString("nfc_txt_connectMessage", comment: ""),
secureChannelMessage: NSLocalizedString("nfc_txt_secureChannel", comment: ""),
wrongCardAccessNumberMessage: NSLocalizedString("nfc_txt_wrongCANMessage", comment: ""),
noCardMessage: NSLocalizedString("nfc_txt_noCardMessage", comment: ""),
multipleCardsMessage: NSLocalizedString("nfc_txt_multipleCardsMessage", comment: ""),
unsupportedCardMessage: NSLocalizedString("nfc_txt_unsupportedCardMessage", comment: ""),
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/NFC/NFCSigningFunctionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class NFCSigningFunctionController: SigningFunctionController {
discoveryMessage: NSLocalizedString("nfc_txt_discoveryMessage", comment: ""),
connectMessage: NSLocalizedString("nfc_txt_connectMessage", comment: ""),
secureChannelMessage: NSLocalizedString("nfc_txt_secureChannel", comment: ""),
wrongCardAccessNumberMessage: NSLocalizedString("nfc_txt_wrongCANMessage", comment: ""),
noCardMessage: NSLocalizedString("nfc_txt_noCardMessage", comment: ""),
multipleCardsMessage: NSLocalizedString("nfc_txt_multipleCardsMessage", comment: ""),
unsupportedCardMessage: NSLocalizedString("nfc_txt_unsupportedCardMessage", comment: ""),
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/Resources/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"nfc_txt_multipleCardsMessage" = "Multiple cards found";
"nfc_txt_unsupportedCardMessage" = "Unsupported card";
"nfc_txt_connectionErrorMessage" = "NFC Communication error";
"nfc_txt_wrongCANMessage" = "Incorrect Card Access Number. Please try again.";
"nfc_txt_msg_secure_channel" = "Establishing secure connection..";
"nfc_txt_msg_verify_pin" = "Verifying pin...";
"nfc_txt_msg_reading_auth_cert"= "Reading authentication certificate...";
Expand Down
1 change: 1 addition & 0 deletions Sources/NFCDemo/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"nfc_txt_multipleCardsMessage" = "Es wurden mehrere Karten gefunden";
"nfc_txt_unsupportedCardMessage" = "Karte wird nicht unterstützt";
"nfc_txt_connectionErrorMessage" = "NFC Kommunikationsfehler";
"nfc_txt_wrongCANMessage" = "Falsche Zugangsnummer. Bitte versuchen Sie es erneut.";
"nfc_txt_msg_secure_channel" = "Sichere Verbindung aufbauen...";
"nfc_txt_msg_verify_pin" = "PIN verifizieren...";
"nfc_txt_msg_reading_auth_cert"= "Zertifikat lesen...";
Expand Down