diff --git a/XMTPiOSExample/NotificationService/NotificationService.swift b/XMTPiOSExample/NotificationService/NotificationService.swift index 27f07d1c..9485c065 100644 --- a/XMTPiOSExample/NotificationService/NotificationService.swift +++ b/XMTPiOSExample/NotificationService/NotificationService.swift @@ -40,7 +40,7 @@ class NotificationService: UNNotificationServiceExtension { let client = try await Client.from(bundle: keys) let conversation = conversationContainer.decode(with: client) - let envelope = XMTP.Envelope.with { envelope in + let envelope = XMTPiOS.Envelope.with { envelope in envelope.message = encryptedMessageData envelope.contentTopic = topic } diff --git a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj index 8ff068ce..ab095843 100644 --- a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj +++ b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj @@ -20,17 +20,17 @@ A65F0704297B5D4E00C3C76E /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = A65F0703297B5D4E00C3C76E /* Persistence.swift */; }; A65F0707297B5E7600C3C76E /* WalletConnectSwift in Frameworks */ = {isa = PBXBuildFile; productRef = A65F0706297B5E7600C3C76E /* WalletConnectSwift */; }; A65F070A297B5E8600C3C76E /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = A65F0709297B5E8600C3C76E /* KeychainAccess */; }; + A6606A182B5EE7F000E2ED4D /* XMTPiOS in Frameworks */ = {isa = PBXBuildFile; productRef = A6606A172B5EE7F000E2ED4D /* XMTPiOS */; }; + A6606A1A2B5EE80000E2ED4D /* XMTPiOS in Frameworks */ = {isa = PBXBuildFile; productRef = A6606A192B5EE80000E2ED4D /* XMTPiOS */; }; A67CCEC129355B4B00131F5C /* AccountManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A67CCEC029355B4B00131F5C /* AccountManager.swift */; }; A683860C293EA862006336FF /* MessageListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A683860B293EA862006336FF /* MessageListView.swift */; }; A687810729679BC700042FAB /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = A687810629679BC700042FAB /* Account.swift */; }; A687810C29679BFC00042FAB /* WalletConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A687810B29679BFC00042FAB /* WalletConnection.swift */; }; A687810E29679C0D00042FAB /* WalletConnectionMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = A687810D29679C0D00042FAB /* WalletConnectionMethod.swift */; }; - A69F33C6292DC992005A5556 /* XMTP in Frameworks */ = {isa = PBXBuildFile; productRef = A69F33C5292DC992005A5556 /* XMTP */; }; A69F33CA292DD557005A5556 /* LoggedInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69F33C9292DD557005A5556 /* LoggedInView.swift */; }; A69F33CC292DD568005A5556 /* QRCodeSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69F33CB292DD568005A5556 /* QRCodeSheetView.swift */; }; A6AE5187297B61AE006FDD0F /* NotificationService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A6AE5180297B61AE006FDD0F /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; A6AE518E297B6210006FDD0F /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6AE518C297B6210006FDD0F /* NotificationService.swift */; }; - A6AE5191297B625F006FDD0F /* XMTP in Frameworks */ = {isa = PBXBuildFile; productRef = A6AE5190297B625F006FDD0F /* XMTP */; }; A6AE5192297B6270006FDD0F /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = A65F0703297B5D4E00C3C76E /* Persistence.swift */; }; A6AE5194297B62C8006FDD0F /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = A6AE5193297B62C8006FDD0F /* KeychainAccess */; }; A6C0F37B2AC1E321008C6AA7 /* Starscream in Frameworks */ = {isa = PBXBuildFile; productRef = A6C0F37A2AC1E321008C6AA7 /* Starscream */; }; @@ -40,7 +40,6 @@ A6C0F3842AC1E4B5008C6AA7 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6C0F3832AC1E4B5008C6AA7 /* LoginView.swift */; }; A6C0F3862AC1E549008C6AA7 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6C0F3852AC1E549008C6AA7 /* Data.swift */; }; A6D192D0293A7B97006B49F2 /* ConversationListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D192CF293A7B97006B49F2 /* ConversationListView.swift */; }; - A6E774162B154CF000F01DFF /* XMTP in Frameworks */ = {isa = PBXBuildFile; productRef = A6E774152B154CF000F01DFF /* XMTP */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -101,13 +100,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A6E774162B154CF000F01DFF /* XMTP in Frameworks */, A65F0707297B5E7600C3C76E /* WalletConnectSwift in Frameworks */, A6C0F3802AC1E34F008C6AA7 /* WalletConnectModal in Frameworks */, + A6606A1A2B5EE80000E2ED4D /* XMTPiOS in Frameworks */, 6AEE396E29F330CD0027B657 /* secp256k1 in Frameworks */, A6C0F37E2AC1E34F008C6AA7 /* WalletConnect in Frameworks */, A6C0F3822AC1E34F008C6AA7 /* Web3Wallet in Frameworks */, - A69F33C6292DC992005A5556 /* XMTP in Frameworks */, A6C0F37B2AC1E321008C6AA7 /* Starscream in Frameworks */, A65F070A297B5E8600C3C76E /* KeychainAccess in Frameworks */, ); @@ -118,7 +116,7 @@ buildActionMask = 2147483647; files = ( A6AE5194297B62C8006FDD0F /* KeychainAccess in Frameworks */, - A6AE5191297B625F006FDD0F /* XMTP in Frameworks */, + A6606A182B5EE7F000E2ED4D /* XMTPiOS in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -240,7 +238,6 @@ ); name = XMTPiOSExample; packageProductDependencies = ( - A69F33C5292DC992005A5556 /* XMTP */, A65F0706297B5E7600C3C76E /* WalletConnectSwift */, A65F0709297B5E8600C3C76E /* KeychainAccess */, 6AEE396D29F330CD0027B657 /* secp256k1 */, @@ -248,7 +245,7 @@ A6C0F37D2AC1E34F008C6AA7 /* WalletConnect */, A6C0F37F2AC1E34F008C6AA7 /* WalletConnectModal */, A6C0F3812AC1E34F008C6AA7 /* Web3Wallet */, - A6E774152B154CF000F01DFF /* XMTP */, + A6606A192B5EE80000E2ED4D /* XMTPiOS */, ); productName = XMTPiOSExample; productReference = A628198F292DC825004B9117 /* XMTPiOSExample.app */; @@ -268,8 +265,8 @@ ); name = NotificationService; packageProductDependencies = ( - A6AE5190297B625F006FDD0F /* XMTP */, A6AE5193297B62C8006FDD0F /* KeychainAccess */, + A6606A172B5EE7F000E2ED4D /* XMTPiOS */, ); productName = NotificationService; productReference = A6AE5180297B61AE006FDD0F /* NotificationService.appex */; @@ -722,13 +719,13 @@ package = A65F0708297B5E8600C3C76E /* XCRemoteSwiftPackageReference "KeychainAccess" */; productName = KeychainAccess; }; - A69F33C5292DC992005A5556 /* XMTP */ = { + A6606A172B5EE7F000E2ED4D /* XMTPiOS */ = { isa = XCSwiftPackageProductDependency; - productName = XMTP; + productName = XMTPiOS; }; - A6AE5190297B625F006FDD0F /* XMTP */ = { + A6606A192B5EE80000E2ED4D /* XMTPiOS */ = { isa = XCSwiftPackageProductDependency; - productName = XMTP; + productName = XMTPiOS; }; A6AE5193297B62C8006FDD0F /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; @@ -755,10 +752,6 @@ package = A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */; productName = Web3Wallet; }; - A6E774152B154CF000F01DFF /* XMTP */ = { - isa = XCSwiftPackageProductDependency; - productName = XMTP; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = A6281987292DC825004B9117 /* Project object */; diff --git a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 33ba1db5..24ae34d9 100644 --- a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -54,6 +54,15 @@ "revision" : "ecb18d8ce4d88277cc4fb103973352d91e18c535" } }, + { + "identity" : "libxmtp-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/xmtp/libxmtp-swift", + "state" : { + "branch" : "60b99d0", + "revision" : "60b99d04f642a7e2b15156d818dabc4aab65b1c0" + } + }, { "identity" : "qrcode", "kind" : "remoteSourceControl", @@ -242,15 +251,6 @@ "revision" : "53fe0639a98903858d0196b699720decb42aee7b", "version" : "2.14.0" } - }, - { - "identity" : "xmtp-rust-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/xmtp/xmtp-rust-swift", - "state" : { - "branch" : "main", - "revision" : "e08af6942841054ae02a6fe01d90d18e76d5f248" - } } ], "version" : 2 diff --git a/XMTPiOSExample/XMTPiOSExample/Views/ConversationDetailView.swift b/XMTPiOSExample/XMTPiOSExample/Views/ConversationDetailView.swift index 8fb8ab06..39534bd4 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/ConversationDetailView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/ConversationDetailView.swift @@ -9,8 +9,8 @@ import SwiftUI import XMTPiOS struct ConversationDetailView: View { - var client: XMTP.Client - var conversation: XMTP.Conversation + var client: Client + var conversation: Conversation @State private var messages: [DecodedMessage] = [] diff --git a/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift b/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift index b9de7d2c..ee6ba00f 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/ConversationListView.swift @@ -9,10 +9,10 @@ import SwiftUI import XMTPiOS struct ConversationListView: View { - var client: XMTP.Client + var client: XMTPiOS.Client @EnvironmentObject var coordinator: EnvironmentCoordinator - @State private var conversations: [XMTP.Conversation] = [] + @State private var conversations: [XMTPiOS.Conversation] = [] @State private var isShowingNewConversation = false var body: some View { diff --git a/XMTPiOSExample/XMTPiOSExample/Views/LoggedInView.swift b/XMTPiOSExample/XMTPiOSExample/Views/LoggedInView.swift index bbd917cb..33afc323 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/LoggedInView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/LoggedInView.swift @@ -13,7 +13,7 @@ class EnvironmentCoordinator: ObservableObject { } struct LoggedInView: View { - var client: XMTP.Client + var client: XMTPiOS.Client @StateObject var environmentCoordinator = EnvironmentCoordinator() diff --git a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift index 508e4e8c..a485296c 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift @@ -71,9 +71,9 @@ class Signer: SigningKey { } var cancellable: AnyCancellable? - var continuation: CheckedContinuation? + var continuation: CheckedContinuation? - func sign(_ data: Data) async throws -> XMTP.Signature { + func sign(_ data: Data) async throws -> Signature { let address = account.address let topic = session.topic let blockchain = account.blockchain @@ -101,7 +101,7 @@ class Signer: SigningKey { } } - func sign(message: String) async throws -> XMTP.Signature { + func sign(message: String) async throws -> Signature { try await sign(Data(message.utf8)) } } diff --git a/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift b/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift index 11e63e0e..18c05699 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift @@ -39,12 +39,12 @@ struct MessageListView_Previews: PreviewProvider { PreviewClientProvider { client in MessageListView( myAddress: "0x00", messages: [ - XMTP.DecodedMessage.preview(client: client, topic: "foo", body: "Hello", senderAddress: "0x00", sent: Date().addingTimeInterval(-10)), - XMTP.DecodedMessage.preview(client: client, topic: "foo",body: "Oh hi", senderAddress: "0x01", sent: Date().addingTimeInterval(-9)), - XMTP.DecodedMessage.preview(client: client, topic: "foo",body: "Sup", senderAddress: "0x01", sent: Date().addingTimeInterval(-8)), - XMTP.DecodedMessage.preview(client: client, topic: "foo",body: "Nice to see you", senderAddress: "0x00", sent: Date().addingTimeInterval(-7)), - XMTP.DecodedMessage.preview(client: client, topic: "foo",body: "What if it's a longer message I mean really really long like should it wrap?", senderAddress: "0x01", sent: Date().addingTimeInterval(-6)), - XMTP.DecodedMessage.preview(client: client, topic: "foo",body: "🧐", senderAddress: "0x00", sent: Date().addingTimeInterval(-5)), + DecodedMessage.preview(client: client, topic: "foo", body: "Hello", senderAddress: "0x00", sent: Date().addingTimeInterval(-10)), + DecodedMessage.preview(client: client, topic: "foo",body: "Oh hi", senderAddress: "0x01", sent: Date().addingTimeInterval(-9)), + DecodedMessage.preview(client: client, topic: "foo",body: "Sup", senderAddress: "0x01", sent: Date().addingTimeInterval(-8)), + DecodedMessage.preview(client: client, topic: "foo",body: "Nice to see you", senderAddress: "0x00", sent: Date().addingTimeInterval(-7)), + DecodedMessage.preview(client: client, topic: "foo",body: "What if it's a longer message I mean really really long like should it wrap?", senderAddress: "0x01", sent: Date().addingTimeInterval(-6)), + DecodedMessage.preview(client: client, topic: "foo",body: "🧐", senderAddress: "0x00", sent: Date().addingTimeInterval(-5)), ] ) } diff --git a/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift b/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift index c40170a5..e6befdbc 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/NewConversationView.swift @@ -9,7 +9,7 @@ import SwiftUI import XMTPiOS struct NewConversationView: View { - var client: XMTP.Client + var client: XMTPiOS.Client var onCreate: (Conversation) -> Void @Environment(\.dismiss) var dismiss