Skip to content

Commit

Permalink
Added fix for DG11 names - thanks @TerjeLon
Browse files Browse the repository at this point in the history
Added fix for missing reader session invalidation - thanks @TerjeLon
  • Loading branch information
AndyQ committed Jun 14, 2022
1 parent 25ead1f commit d2a659b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.0.0
Switched app over to user async/await - makes the code paths much simpler
Added fix for DG11 names - thanks @TerjeLon
Added fix for missing reader session invalidation - thanks @TerjeLon

v1.1.9
Retrieves names from DG11 if present otherwise fall back to DG1 - thanks @TerjeLon
Fixed bug with Chip Authentication - thanks @pauphi and @jennytellne-cygni
Expand Down
2 changes: 1 addition & 1 deletion Sources/NFCPassportReader/NFCPassportModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class NFCPassportModel {
// Extract fields from DG11 if present
private lazy var names : [String] = {
guard let dg11 = dataGroupsRead[.DG11] as? DataGroup11,
let fullName = dg11.fullName?.components(separatedBy: " ") else { return (passportDataElements?["5B"] ?? "?").components(separatedBy: "<<") }
let fullName = dg11.fullName?.components(separatedBy: "<<") else { return (passportDataElements?["5B"] ?? "?").components(separatedBy: "<<") }
return fullName
}()

Expand Down
1 change: 1 addition & 0 deletions Sources/NFCPassportReader/PassportReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ extension PassportReader : NFCTagReaderSessionDelegate {
// If necessary, you may handle the error. Note session is no longer valid.
// You must create a new session to restart RF polling.
Log.debug( "tagReaderSession:didInvalidateWithError - \(error.localizedDescription)" )
self.readerSession?.invalidate()
self.readerSession = nil

if let readerError = error as? NFCReaderError, readerError.code == NFCReaderError.readerSessionInvalidationErrorUserCanceled
Expand Down

0 comments on commit d2a659b

Please sign in to comment.