diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 1118178dfef93cbdafbccdbfdbd572ff027bc961..6147b07eb28b1d32c4af098309f1427b4a2b2884 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -186,7 +186,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.5; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -240,7 +240,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.5; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000000000000000000000000000000000..5b49d0153fba0965cde423d729297a5b5894bae8 --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,95 @@ +{ + "pins" : [ + { + "identity" : "combine-schedulers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/combine-schedulers", + "state" : { + "revision" : "4cf088c29a20f52be0f2ca54992b492c54e0076b", + "version" : "0.5.3" + } + }, + { + "identity" : "keychainaccess", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kishikawakatsumi/KeychainAccess.git", + "state" : { + "revision" : "84e546727d66f1adc5439debad16270d0fdd04e7", + "version" : "4.2.2" + } + }, + { + "identity" : "swift-case-paths", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-case-paths", + "state" : { + "revision" : "ce9c0d897db8a840c39de64caaa9b60119cf4be8", + "version" : "0.8.1" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "48254824bb4248676bf7ce56014ff57b142b77eb", + "version" : "1.0.2" + } + }, + { + "identity" : "swift-composable-architecture", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-composable-architecture.git", + "state" : { + "revision" : "c307541328a636b9e8e25ac868d89be54a8f8dbf", + "version" : "0.35.0" + } + }, + { + "identity" : "swift-composable-presentation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/darrarski/swift-composable-presentation.git", + "state" : { + "revision" : "1f4d17fae1f7ed41cbed17929083190fd9a78ee6", + "version" : "0.5.2" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "c4f78db9b90ca57b7b6abc2223e235242739ea3c", + "version" : "0.4.0" + } + }, + { + "identity" : "swift-identified-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-identified-collections", + "state" : { + "revision" : "2d6b7ffcc67afd9077fac5e5a29bcd6d39b71076", + "version" : "0.4.0" + } + }, + { + "identity" : "swiftui-app-icon-creator", + "kind" : "remoteSourceControl", + "location" : "https://github.com/darrarski/swiftui-app-icon-creator.git", + "state" : { + "revision" : "f0c7ba4e66d3dc8135ccf9146afc05f9dff3c4ff", + "version" : "1.2.0" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "50a70a9d3583fe228ce672e8923010c8df2deddd", + "version" : "0.2.1" + } + } + ], + "version" : 2 +} diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings index ccd958e618b71e7946c6e9afaba0bcefdabcb5bf..131f1d78c3fcf2a02582bd922f5392f81d5691eb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings index ccd958e618b71e7946c6e9afaba0bcefdabcb5bf..131f1d78c3fcf2a02582bd922f5392f81d5691eb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings index ccd958e618b71e7946c6e9afaba0bcefdabcb5bf..131f1d78c3fcf2a02582bd922f5392f81d5691eb 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings index 79d4ca8d48c3c58f8b660c1644567f0d9a9eaca9..f02c6797986c50582c50cb819be74ee33621d8ae 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings index 79d4ca8d48c3c58f8b660c1644567f0d9a9eaca9..f02c6797986c50582c50cb819be74ee33621d8ae 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings index 79d4ca8d48c3c58f8b660c1644567f0d9a9eaca9..f02c6797986c50582c50cb819be74ee33621d8ae 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index 24d5cc9bca1be47de6ccf3a6e1cdfe505003ae1c..fd68e56619ed543b72bbf05da1ba2474e119ef12 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -234,7 +234,7 @@ Returns marshalled E2ESendReport /** * E2ESendReport is the bindings representation of the return values of SendE2E Example E2ESendReport: -{"RoundList":{"Rounds":[1,5,9]}, +{"Rounds":[1,5,9], "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=", "Timestamp":1653582683183384000} */ diff --git a/Sources/ElixxirDAppsSDK/ConnectionMaker.swift b/Sources/ElixxirDAppsSDK/ConnectionMaker.swift index a898075f447753cba661589313ba86212727ebae..aa492cc6c84e73846c2caf30a8677b8bbf429dd7 100644 --- a/Sources/ElixxirDAppsSDK/ConnectionMaker.swift +++ b/Sources/ElixxirDAppsSDK/ConnectionMaker.swift @@ -15,7 +15,7 @@ public struct ConnectionMaker { extension ConnectionMaker { public static func live(bindingsClient: BindingsClient) -> ConnectionMaker { ConnectionMaker { withAuthentication, recipientContact, myIdentity in - if withAuthentication { + if !withAuthentication { return Connection.live( bindingsConnection: try bindingsClient.connect( recipientContact, diff --git a/Sources/ElixxirDAppsSDK/MessageSendReport.swift b/Sources/ElixxirDAppsSDK/MessageSendReport.swift index 687fc08d83d38b215b27a4a804134c19f99d8505..d5b48cdd480b103d528b09e2db3cfd14be6b224c 100644 --- a/Sources/ElixxirDAppsSDK/MessageSendReport.swift +++ b/Sources/ElixxirDAppsSDK/MessageSendReport.swift @@ -1,51 +1,39 @@ import Foundation public struct MessageSendReport: Equatable { - public init( - roundList: [Int], - messageId: Data, - timestamp: Int - ) { - self.roundList = roundList - self.messageId = messageId - self.timestamp = timestamp - } - - public var roundList: [Int] - public var messageId: Data - public var timestamp: Int + public init( + roundList: [Int], + messageId: Data, + timestamp: Int + ) { + self.roundList = roundList + self.messageId = messageId + self.timestamp = timestamp + } + + public var roundList: [Int]? + public var messageId: Data? + public var timestamp: Int? } extension MessageSendReport: Codable { - enum CodingKeys: String, CodingKey { - case roundList = "RoundList" - case messageId = "MessageID" - case timestamp = "Timestamp" - } - - enum RoundListCodingKeys: String, CodingKey { - case rounds = "Rounds" - } - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - messageId = try container.decode(Data.self, forKey: .messageId) - timestamp = try container.decode(Int.self, forKey: .timestamp) - let roundListContainer = try container.nestedContainer( - keyedBy: RoundListCodingKeys.self, - forKey: .roundList - ) - roundList = try roundListContainer.decode([Int].self, forKey: .rounds) - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(messageId, forKey: .messageId) - try container.encode(timestamp, forKey: .timestamp) - var roundListContainer = container.nestedContainer( - keyedBy: RoundListCodingKeys.self, - forKey: .roundList - ) - try roundListContainer.encode(roundList, forKey: .rounds) - } + enum CodingKeys: String, CodingKey { + case roundList = "Rounds" + case messageId = "MessageID" + case timestamp = "Timestamp" + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + messageId = try container.decodeIfPresent(Data.self, forKey: .messageId) + timestamp = try container.decodeIfPresent(Int.self, forKey: .timestamp) + roundList = try container.decodeIfPresent([Int].self, forKey: .roundList) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(timestamp, forKey: .timestamp) + try container.encode(roundList, forKey: .roundList) + } } diff --git a/Sources/ElixxirDAppsSDK/RestlikeMessage.swift b/Sources/ElixxirDAppsSDK/RestlikeMessage.swift index 48b0e5ef788976a0af37be7b843013e708987656..75e3d421869b31e0ae841a752806490942ee443d 100644 --- a/Sources/ElixxirDAppsSDK/RestlikeMessage.swift +++ b/Sources/ElixxirDAppsSDK/RestlikeMessage.swift @@ -1,37 +1,47 @@ import Foundation public struct RestlikeMessage: Equatable { - public init( - version: Int, - headers: Data, - content: Data, - method: Int, - uri: String, - error: String - ) { - self.version = version - self.headers = headers - self.content = content - self.method = method - self.uri = uri - self.error = error - } - - public var version: Int - public var headers: Data - public var content: Data - public var method: Int - public var uri: String - public var error: String + public init( + version: Int, + headers: Data, + content: Data, + method: Int, + uri: String, + error: String + ) { + self.version = version + self.headers = headers + self.content = content + self.method = method + self.uri = uri + self.error = error + } + + public var version: Int? + public var headers: Data? + public var content: Data? + public var method: Int? + public var uri: String? + public var error: String? } extension RestlikeMessage: Codable { - enum CodingKeys: String, CodingKey { - case version = "Version" - case headers = "Headers" - case content = "Content" - case method = "Method" - case uri = "URI" - case error = "Error" - } + enum CodingKeys: String, CodingKey { + case version = "Version" + case headers = "Headers" + case content = "Content" + case method = "Method" + case uri = "URI" + case error = "Error" + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + version = try container.decodeIfPresent(Int.self, forKey: .version) + headers = try container.decodeIfPresent(Data.self, forKey: .headers) + content = try container.decodeIfPresent(Data.self, forKey: .content) + method = try container.decodeIfPresent(Int.self, forKey: .method) + uri = try container.decodeIfPresent(String.self, forKey: .uri) + error = try container.decodeIfPresent(String.self, forKey: .error) + } }