Skip to content

Commit

Permalink
Expose public OID4VCI HTTP clients initializers (#40)
Browse files Browse the repository at this point in the history
This exposes the Oid4vciSyncHttpClient and Oid4vciAsyncHttpClient initializers that allow creation on the apps.
  • Loading branch information
Juliano1612 authored Oct 8, 2024
1 parent 76d2b77 commit 6ce57e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
targets: ["SpruceIDMobileSdk"])
],
dependencies: [
.package(url: "https://github.com/spruceid/mobile-sdk-rs.git", exact: "0.0.33"),
.package(url: "https://github.com/spruceid/mobile-sdk-rs.git", exact: "0.0.36"),
// .package(path: "../mobile-sdk-rs"),
.package(url: "https://github.com/apple/swift-algorithms", from: "1.2.0")
],
Expand Down
4 changes: 4 additions & 0 deletions Sources/MobileSdk/OID4VCI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Foundation
import SpruceIDMobileSdkRs

public class Oid4vciSyncHttpClient: SyncHttpClient {
public init() {}

public func httpClient(request: HttpRequest) throws -> HttpResponse {
guard let url = URL(string: request.url) else {
throw HttpClientError.Other(error: "failed to construct URL")
Expand Down Expand Up @@ -74,6 +76,8 @@ public class Oid4vciSyncHttpClient: SyncHttpClient {
}

public class Oid4vciAsyncHttpClient: AsyncHttpClient {
public init() {}

public func httpClient(request: HttpRequest) async throws -> HttpResponse {
guard let url = URL(string: request.url) else {
throw HttpClientError.Other(error: "failed to construct URL")
Expand Down
4 changes: 2 additions & 2 deletions SpruceIDMobileSdk.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "SpruceIDMobileSdk"
spec.version = "0.0.11"
spec.version = "0.0.12"
spec.summary = "Swift Mobile SDK."
spec.description = <<-DESC
SpruceID Swift Mobile SDK.
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |spec|
spec.source_files = "Sources/MobileSdk/*.swift"

spec.static_framework = true
spec.dependency 'SpruceIDMobileSdkRs', "~> 0.0.33"
spec.dependency 'SpruceIDMobileSdkRs', "~> 0.0.36"
spec.dependency 'SwiftAlgorithms', "~> 1.0.0"
spec.frameworks = 'Foundation', 'CoreBluetooth', 'CryptoKit'
end

0 comments on commit 6ce57e9

Please sign in to comment.