Skip to content

Commit

Permalink
Fix #40 : Update presentation exchange sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
josmilan authored Aug 12, 2024
1 parent cf17aec commit 20e9b2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/keefertaylor/Base58Swift.git", branch: "master"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.8.1"),
.package(url: "https://github.com/decentralised-dataexchange/PresentationExchangeSdkiOS.git", .upToNextMajor(from: "2024.3.1")),
.package(url: "https://github.com/decentralised-dataexchange/PresentationExchangeSdkiOS.git", .upToNextMajor(from: "2024.8.1")),
.package(url: "https://github.com/airsidemobile/JOSESwift.git", from: "2.3.0"),
.package(url: "https://github.com/apple/swift-crypto.git", from:"3.5.2")
],
Expand Down
17 changes: 6 additions & 11 deletions Sources/eudiWalletOidcIos/Service/VerificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,14 @@ public class VerificationService: NSObject, VerificationServiceProtocol {
fatalError("Failed to convert dictionary to string")
}

let matchesString = matchCredentials(inputDescriptorJson: inputDescriptorString, credentials: processedCredentials)
// Assuming `matchesString` contains a JSON array of matches
if let matchesData = matchesString.data(using: .utf8),
let matchesArray = try? JSONSerialization.jsonObject(with: matchesData) as? [String: Any],
let matchedCredentials = matchesArray["MatchedCredentials"] as? [[String: Any]] {
// Now you have access to the "MatchedCredentials" list
for index in 0..<matchedCredentials.count {
if index < tempCredentialList.count {
filteredCredentialList.append(tempCredentialList[matchedCredentials[index]["index"] as? Int ?? 0] ?? "")
}
do {
let matchesString = try matchCredentials(inputDescriptorJson: inputDescriptorString, credentials: processedCredentials)
for item in matchesString {
filteredCredentialList.append(tempCredentialList[item.index] ?? "")
}
} catch {
print("error")
}

response.append(filteredCredentialList)
}
}
Expand Down

0 comments on commit 20e9b2b

Please sign in to comment.