Skip to content

Commit

Permalink
MOB-1891 - Updated SDKs to cover PrivacyInfo requirement (#491)
Browse files Browse the repository at this point in the history
* Updated WC SDK

* Updated Stripe SDK

* Updated XMTP SDK
  • Loading branch information
Oleg-Pecheneg authored Apr 11, 2024
1 parent 8f4ddfb commit f71be52
Show file tree
Hide file tree
Showing 17 changed files with 139 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import XMTP
import XMTPiOS

struct XMTPPushNotificationsExtensionHelper {
struct NotificationDisplayInfo {
Expand All @@ -32,13 +32,13 @@ struct XMTPPushNotificationsExtensionHelper {

let conversationData = AppGroupsBridgeService.shared.getXMTPConversationDataFor(topic: topic,
userWallet: wallet)
let conversationContainer: XMTP.ConversationContainer = try decodeConversationData(from: conversationData)
let conversationContainer: XMTPiOS.ConversationContainer = try decodeConversationData(from: conversationData)
let conversation = conversationContainer.decode(with: client)
address = conversation.peerAddress

guard AppGroupsBridgeService.shared.getXMTPBlockedUsersList().first(where: { $0.userId == data.toAddress && $0.blockedAddress == conversation.peerAddress }) == nil else { return nil } // Ignore notification from blocked user

let envelope = XMTP.Envelope.with { envelope in
let envelope = XMTPiOS.Envelope.with { envelope in
envelope.message = encryptedMessageData
envelope.contentTopic = topic
}
Expand Down Expand Up @@ -82,17 +82,17 @@ private extension XMTPPushNotificationsExtensionHelper {
}

static func getClientFor(wallet: String,
env: XMTPEnvironment) async throws -> XMTP.Client {
env: XMTPEnvironment) async throws -> XMTPiOS.Client {
if let keysData = KeychainXMTPKeysStorage.instance.getKeysDataFor(identifier: wallet, env: env) {
return try await createClientUsing(keysData: keysData, env: env)
}
throw XMTPPushNotificationError.noClientKeys
}

static func createClientUsing(keysData: Data,
env: XMTPEnvironment) async throws -> XMTP.Client {
env: XMTPEnvironment) async throws -> XMTPiOS.Client {
let keys = try PrivateKeyBundle(serializedData: keysData)
let client = try await XMTP.Client.from(bundle: keys,
let client = try await XMTPiOS.Client.from(bundle: keys,
options: .init(api: .init(env: env,
appVersion: XMTPServiceSharedHelper.getXMTPVersion())))
return client
Expand Down
52 changes: 30 additions & 22 deletions unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
C609831A282B707B00546392 /* UINavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6098319282B707B00546392 /* UINavigationController.swift */; };
C6098322282B8BA300546392 /* WalletViewTransactionsAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6098321282B8BA300546392 /* WalletViewTransactionsAction.swift */; };
C60A31642B464F6000C806A5 /* PreviewMessagingNewsChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60A31632B464F6000C806A5 /* PreviewMessagingNewsChannel.swift */; };
C60BC04B2BC7806F00A79CDB /* XMTPiOS in Frameworks */ = {isa = PBXBuildFile; productRef = C60BC04A2BC7806F00A79CDB /* XMTPiOS */; };
C60BC04D2BC7808400A79CDB /* XMTPiOS in Frameworks */ = {isa = PBXBuildFile; productRef = C60BC04C2BC7808400A79CDB /* XMTPiOS */; };
C60C298C2834E30000626851 /* GroupedCoinRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60C298B2834E30000626851 /* GroupedCoinRecord.swift */; };
C60C29912834E9C200626851 /* ResizableRoundedWalletBadgeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60C29902834E9C200626851 /* ResizableRoundedWalletBadgeImageView.swift */; };
C60C59B22B47F97900A2522C /* PreviewLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60C59B12B47F97900A2522C /* PreviewLoginViewController.swift */; };
Expand Down Expand Up @@ -834,7 +836,7 @@
C651DC51286C115400808D4C /* WatchFaceDomainImagePreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C651DC50286C115400808D4C /* WatchFaceDomainImagePreviewView.swift */; };
C651DC56286C115900808D4C /* WatchFaceDomainImagePreviewView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C651DC55286C115900808D4C /* WatchFaceDomainImagePreviewView.xib */; };
C652446A2AF8A7A400673CC0 /* WalletConnectNotify in Frameworks */ = {isa = PBXBuildFile; productRef = C65244692AF8A7A400673CC0 /* WalletConnectNotify */; };
C652446C2AF8AA2600673CC0 /* WCV2NotifyDefaultCryptoProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C652446B2AF8AA2600673CC0 /* WCV2NotifyDefaultCryptoProvider.swift */; };
C652446C2AF8AA2600673CC0 /* WCV2DefaultCryptoProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C652446B2AF8AA2600673CC0 /* WCV2DefaultCryptoProvider.swift */; };
C652629828110B8500F1D699 /* SecurityWallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C652629628110B8500F1D699 /* SecurityWallViewController.swift */; };
C652629C28110B8500F1D699 /* SecurityWallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C652629728110B8500F1D699 /* SecurityWallViewController.xib */; };
C6526DB929D2BACB00D6F2EB /* UserProfileService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6526DB829D2BACB00D6F2EB /* UserProfileService.swift */; };
Expand Down Expand Up @@ -970,8 +972,6 @@
C66804D5280D9EC8007E6390 /* EnterPasscodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66804BE280D9EC7007E6390 /* EnterPasscodeViewController.swift */; };
C66804D9280D9EC8007E6390 /* SetupPasscodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66804BF280D9EC7007E6390 /* SetupPasscodeViewController.swift */; };
C66804DD280D9EC8007E6390 /* VerifyPasscodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66804C0280D9EC7007E6390 /* VerifyPasscodeViewController.swift */; };
C66811F52B47B1C600BDABB0 /* XMTP in Frameworks */ = {isa = PBXBuildFile; productRef = C66811F42B47B1C600BDABB0 /* XMTP */; };
C66811F72B47B1F000BDABB0 /* XMTP in Frameworks */ = {isa = PBXBuildFile; productRef = C66811F62B47B1F000BDABB0 /* XMTP */; };
C669B44F2B747539001D4788 /* SettingsNavigationDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = C669B44E2B747539001D4788 /* SettingsNavigationDestination.swift */; };
C669B4502B747539001D4788 /* SettingsNavigationDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = C669B44E2B747539001D4788 /* SettingsNavigationDestination.swift */; };
C669B4522B747607001D4788 /* SettingsLinkNavigationDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = C669B4512B747607001D4788 /* SettingsLinkNavigationDestination.swift */; };
Expand Down Expand Up @@ -1011,6 +1011,7 @@
C670695628981C84001FD241 /* TextWarningButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C670695528981C84001FD241 /* TextWarningButton.swift */; };
C67097AC2BABD47E00BB8AB1 /* DebounceObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C67097AB2BABD47E00BB8AB1 /* DebounceObject.swift */; };
C67097AD2BABD47E00BB8AB1 /* DebounceObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C67097AB2BABD47E00BB8AB1 /* DebounceObject.swift */; };
C671CD2D2BC7758B005DA2FB /* StripePaymentSheet in Frameworks */ = {isa = PBXBuildFile; productRef = C671CD2C2BC7758B005DA2FB /* StripePaymentSheet */; };
C671E38728FE85C800A2B3A0 /* CarouselView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C671E38628FE85C800A2B3A0 /* CarouselView.swift */; };
C671E38E28FE86EB00A2B3A0 /* CarouselCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C671E38C28FE86EB00A2B3A0 /* CarouselCollectionViewCell.swift */; };
C671E39228FE86EB00A2B3A0 /* CarouselCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C671E38D28FE86EB00A2B3A0 /* CarouselCollectionViewCell.xib */; };
Expand Down Expand Up @@ -3182,7 +3183,7 @@
C650E2952B9E9878002C120A /* UDButtonStyle+ViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UDButtonStyle+ViewModifier.swift"; sourceTree = "<group>"; };
C651DC50286C115400808D4C /* WatchFaceDomainImagePreviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchFaceDomainImagePreviewView.swift; sourceTree = "<group>"; };
C651DC55286C115900808D4C /* WatchFaceDomainImagePreviewView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WatchFaceDomainImagePreviewView.xib; sourceTree = "<group>"; };
C652446B2AF8AA2600673CC0 /* WCV2NotifyDefaultCryptoProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WCV2NotifyDefaultCryptoProvider.swift; sourceTree = "<group>"; };
C652446B2AF8AA2600673CC0 /* WCV2DefaultCryptoProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WCV2DefaultCryptoProvider.swift; sourceTree = "<group>"; };
C652629628110B8500F1D699 /* SecurityWallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityWallViewController.swift; sourceTree = "<group>"; };
C652629728110B8500F1D699 /* SecurityWallViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SecurityWallViewController.xib; sourceTree = "<group>"; };
C6526DB829D2BACB00D6F2EB /* UserProfileService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileService.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3982,8 +3983,9 @@
C61ECD862A25AB4200E97D70 /* SocketIO in Frameworks */,
290A604C2950AA1600882109 /* WalletConnectNetworking in Frameworks */,
307B1D5A2603C8E0007B14C3 /* BigInt in Frameworks */,
C60BC04B2BC7806F00A79CDB /* XMTPiOS in Frameworks */,
290A60502950AA1600882109 /* WalletConnectPush in Frameworks */,
C66811F52B47B1C600BDABB0 /* XMTP in Frameworks */,
C671CD2D2BC7758B005DA2FB /* StripePaymentSheet in Frameworks */,
2917EDDD2A6F25AB004EAB31 /* Web3ContractABI in Frameworks */,
C689C1732ADE484300AA0186 /* LaunchDarkly in Frameworks */,
290A604E2950AA1600882109 /* WalletConnectPairing in Frameworks */,
Expand Down Expand Up @@ -4029,11 +4031,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C66811F72B47B1F000BDABB0 /* XMTP in Frameworks */,
C60CB2E02A7CB62E00663989 /* web3swift in Frameworks */,
C65DD4C62A7CABC700CAB10C /* Valet in Frameworks */,
C6E69FA3288AB821000A8346 /* SVGKit in Frameworks */,
C6E69F99288AB6DC000A8346 /* Bugsnag in Frameworks */,
C60BC04D2BC7808400A79CDB /* XMTPiOS in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -6138,7 +6140,7 @@
isa = PBXGroup;
children = (
C6E69FF0288AD9DB000A8346 /* NotificationsService.swift */,
C652446B2AF8AA2600673CC0 /* WCV2NotifyDefaultCryptoProvider.swift */,
C652446B2AF8AA2600673CC0 /* WCV2DefaultCryptoProvider.swift */,
C665FC1E29B06896009699D2 /* NotificationsServiceProtocol.swift */,
C665FC2329B068A3009699D2 /* MockNotificationsService.swift */,
);
Expand Down Expand Up @@ -8279,8 +8281,9 @@
C689C1722ADE484300AA0186 /* LaunchDarkly */,
C65244692AF8A7A400673CC0 /* WalletConnectNotify */,
C607A5CC2B3288900088ECF3 /* Amplitude */,
C66811F42B47B1C600BDABB0 /* XMTP */,
C61B6C732BA0052C007408FD /* Push */,
C671CD2C2BC7758B005DA2FB /* StripePaymentSheet */,
C60BC04A2BC7806F00A79CDB /* XMTPiOS */,
);
productName = "domains-manager-ios";
productReference = 3064867D2527253700388026 /* domains-manager-ios.app */;
Expand Down Expand Up @@ -8357,7 +8360,7 @@
C6E69FA2288AB821000A8346 /* SVGKit */,
C65DD4C52A7CABC700CAB10C /* Valet */,
C60CB2DF2A7CB62E00663989 /* web3swift */,
C66811F62B47B1F000BDABB0 /* XMTP */,
C60BC04C2BC7808400A79CDB /* XMTPiOS */,
);
productName = NotificationServiceExtension;
productReference = C6E69F8A288A93D2000A8346 /* NotificationServiceExtension.appex */;
Expand Down Expand Up @@ -9254,7 +9257,7 @@
C6010D15287EE5C700FBD401 /* BuyDomainsWebViewController.swift in Sources */,
C60610D429A4FF84005DC0D5 /* WCRequestsHandlingService.swift in Sources */,
C655CA972B16E51B00FDA063 /* View+Skeleton.swift in Sources */,
C652446C2AF8AA2600673CC0 /* WCV2NotifyDefaultCryptoProvider.swift in Sources */,
C652446C2AF8AA2600673CC0 /* WCV2DefaultCryptoProvider.swift in Sources */,
291A9C6A29E444CF00527FF1 /* WC_v1+v2.swift in Sources */,
C655CA962B16E51B00FDA063 /* Color+Skeleton.swift in Sources */,
C6D6457A2B1D7C2F00D724AC /* PullUpError.swift in Sources */,
Expand Down Expand Up @@ -11775,7 +11778,7 @@
repositoryURL = "https://github.com/WalletConnect/WalletConnectSwiftV2";
requirement = {
kind = exactVersion;
version = 1.11.0;
version = 1.18.4;
};
};
29BF9FDF2A6ED48A00EDA0DF /* XCRemoteSwiftPackageReference "Boilertalk-Web3.swift" */ = {
Expand All @@ -11799,7 +11802,7 @@
repositoryURL = "https://github.com/stripe/stripe-ios";
requirement = {
kind = exactVersion;
version = 22.8.4;
version = 23.27.0;
};
};
30CE604A26A9DED000E0D29B /* XCRemoteSwiftPackageReference "web3swift" */ = {
Expand Down Expand Up @@ -11862,8 +11865,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/xmtp/xmtp-ios";
requirement = {
kind = revision;
revision = af277a00fb254a1916da8db12caf480655d4894d;
branch = 0a625c91e56538280363c43900b91266554fa515;
kind = branch;
};
};
C689C1712ADE47AF00AA0186 /* XCRemoteSwiftPackageReference "ios-client-sdk" */ = {
Expand Down Expand Up @@ -11960,6 +11963,16 @@
package = C607A5CB2B3288800088ECF3 /* XCRemoteSwiftPackageReference "Amplitude-iOS" */;
productName = Amplitude;
};
C60BC04A2BC7806F00A79CDB /* XMTPiOS */ = {
isa = XCSwiftPackageProductDependency;
package = C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */;
productName = XMTPiOS;
};
C60BC04C2BC7808400A79CDB /* XMTPiOS */ = {
isa = XCSwiftPackageProductDependency;
package = C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */;
productName = XMTPiOS;
};
C60CB2DF2A7CB62E00663989 /* web3swift */ = {
isa = XCSwiftPackageProductDependency;
package = 30CE604A26A9DED000E0D29B /* XCRemoteSwiftPackageReference "web3swift" */;
Expand Down Expand Up @@ -11995,15 +12008,10 @@
package = C63812222993E009002590E7 /* XCRemoteSwiftPackageReference "Valet-ios" */;
productName = Valet;
};
C66811F42B47B1C600BDABB0 /* XMTP */ = {
isa = XCSwiftPackageProductDependency;
package = C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */;
productName = XMTP;
};
C66811F62B47B1F000BDABB0 /* XMTP */ = {
C671CD2C2BC7758B005DA2FB /* StripePaymentSheet */ = {
isa = XCSwiftPackageProductDependency;
package = C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */;
productName = XMTP;
package = 30B6583726A9E75E004F707F /* XCRemoteSwiftPackageReference "stripe-ios" */;
productName = StripePaymentSheet;
};
C689C1722ADE484300AA0186 /* LaunchDarkly */ = {
isa = XCSwiftPackageProductDependency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/bufbuild/connect-swift",
"state" : {
"revision" : "6f5afc57f44a3ed15b9a01381ce73f84d15e43db",
"version" : "0.3.0"
"revision" : "1701d3d1b2c4c63fcccfd7094f86a88672fa5acb",
"version" : "0.12.0"
}
},
{
Expand Down Expand Up @@ -91,6 +91,15 @@
"version" : "9.5.0"
}
},
{
"identity" : "libxmtp-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/libxmtp-swift",
"state" : {
"revision" : "fa57437cc1a84df566c91bbd5df1d0619d404e09",
"version" : "0.4.3-beta4"
}
},
{
"identity" : "objectivepgp",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -158,8 +167,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/stripe/stripe-ios",
"state" : {
"revision" : "e242f59ce90914e93c8308e0c3ceba7368575b77",
"version" : "22.8.4"
"revision" : "febc79a4c5e02afce39d68211268cbad7c304a8f",
"version" : "23.27.0"
}
},
{
Expand Down Expand Up @@ -221,8 +230,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "702cd7c56d5d44eeba73fdf83918339b26dc855c",
"version" : "2.62.0"
"revision" : "fc63f0cf4e55a4597407a9fc95b16a2bc44b4982",
"version" : "2.64.0"
}
},
{
Expand All @@ -239,17 +248,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "3bd9004b9d685ed6b629760fc84903e48efec806",
"version" : "1.29.0"
"revision" : "0904bf0feb5122b7e5c3f15db7df0eabe623dd87",
"version" : "1.30.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9",
"version" : "2.25.0"
"revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5",
"version" : "2.26.0"
}
},
{
Expand Down Expand Up @@ -279,6 +288,15 @@
"version" : "1.0.3"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
"version" : "1.2.1"
}
},
{
"identity" : "swiftimagereadwrite",
"kind" : "remoteSourceControl",
Expand All @@ -302,8 +320,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/WalletConnect/WalletConnectSwiftV2",
"state" : {
"revision" : "232090b71756417c2ba44cda78ff57bc5ef54ca2",
"version" : "1.11.0"
"revision" : "c9ea7a1836e5a58636c3df528a21997187bd54ac",
"version" : "1.18.4"
}
},
{
Expand Down Expand Up @@ -338,16 +356,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/xmtp-ios",
"state" : {
"revision" : "af277a00fb254a1916da8db12caf480655d4894d"
}
},
{
"identity" : "xmtp-rust-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/xmtp-rust-swift",
"state" : {
"branch" : "main",
"revision" : "e08af6942841054ae02a6fe01d90d18e76d5f248"
"revision" : "0a625c91e56538280363c43900b91266554fa515"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private extension QRScannerViewPresenter {
if let view = self.view {
await appContext.pullUpViewService.showWCInvalidQRCodePullUp(in: view)
}
throw ScanningError.notSupportedQRCode
throw error
}
}

Expand All @@ -217,13 +217,3 @@ private extension QRScannerViewPresenter {
await Task.sleep(seconds: interval)
}
}

extension QRScannerViewPresenter {
enum ScanningError: String, LocalizedError {
case notSupportedQRCode
case notSupportedQRCodeV2

public var errorDescription: String? { rawValue }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//

import Foundation
import XMTP
import XMTPiOS

struct MessagingAPIServiceHelper {
static func getXMTPConversationFromChat(_ chat: MessagingChat,
client: XMTP.Client) throws -> XMTP.Conversation {
client: XMTPiOS.Client) throws -> XMTPiOS.Conversation {
let metadata: XMTPEnvironmentNamespace.ChatServiceMetadata = try decodeServiceMetadata(from: chat.serviceMetadata)
return metadata.encodedContainer.decode(with: client)
}
Expand Down
Loading

0 comments on commit f71be52

Please sign in to comment.