-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1361 from WalletConnect/caip222-over-universal-li…
…nking Caip222 over universal linking
- Loading branch information
Showing
86 changed files
with
2,643 additions
and
472 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
.swiftpm/xcode/xcshareddata/xcschemes/WalletConnectKMSTests.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1530" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "WalletConnectKMSTests" | ||
BuildableName = "WalletConnectKMSTests" | ||
BlueprintName = "WalletConnectKMSTests" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
import Foundation | ||
|
||
enum Constants { | ||
static let groupIdentifier = "group.com.walletconnect.dapp" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.developer.associated-domains</key> | ||
<array> | ||
<string>applinks:lab.web3modal.com</string> | ||
</array> | ||
<key>com.apple.security.application-groups</key> | ||
<array> | ||
<string>group.com.walletconnect.dapp</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import SwiftUI | ||
|
||
final class ConfigModule { | ||
@discardableResult | ||
static func create(app: Application) -> UIViewController { | ||
let router = ConfigRouter(app: app) | ||
let presenter = ConfigPresenter(router: router) | ||
let view = ConfigView().environmentObject(presenter) | ||
|
||
let viewController = SceneViewController(viewModel: presenter, content: view) | ||
router.viewController = viewController | ||
|
||
return viewController | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import UIKit | ||
import Combine | ||
|
||
import WalletConnectSign | ||
|
||
final class ConfigPresenter: ObservableObject, SceneViewModel { | ||
|
||
|
||
private let router: ConfigRouter | ||
|
||
init( | ||
router: ConfigRouter | ||
) { | ||
defer { setupInitialState() } | ||
self.router = router | ||
} | ||
|
||
func onAppear() { | ||
|
||
} | ||
|
||
private func setupInitialState() { | ||
|
||
} | ||
|
||
func cleanLinkModeSupportedWalletsCache() { | ||
let userDefaults = UserDefaults(suiteName: Constants.groupIdentifier)! | ||
let prefix = "com.walletconnect.sdk.linkModeLinks" | ||
let keys = userDefaults.dictionaryRepresentation().keys | ||
|
||
for key in keys where key.hasPrefix(prefix) { | ||
userDefaults.removeObject(forKey: key) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import Foundation | ||
import UIKit | ||
import WalletConnectSign | ||
|
||
final class ConfigRouter { | ||
weak var viewController: UIViewController! | ||
|
||
private let app: Application | ||
|
||
init(app: Application) { | ||
self.app = app | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import SwiftUI | ||
|
||
struct ConfigView: View { | ||
@EnvironmentObject var presenter: ConfigPresenter | ||
|
||
var body: some View { | ||
NavigationStack { | ||
ZStack { | ||
Color(red: 25/255, green: 26/255, blue: 26/255) | ||
.ignoresSafeArea() | ||
|
||
ScrollView { | ||
VStack { | ||
Button { | ||
presenter.cleanLinkModeSupportedWalletsCache() | ||
} label: { | ||
HStack { | ||
Spacer() | ||
Text("Clean Link Mode Supported Wallets Cache") | ||
.font(.system(size: 16, weight: .semibold)) | ||
.foregroundColor(.white) | ||
.padding(.vertical, 25) | ||
Spacer() | ||
} | ||
.background(Color(red: 95/255, green: 159/255, blue: 248/255)) | ||
.cornerRadius(16) | ||
} | ||
.padding(.top, 10) | ||
} | ||
.padding(12) | ||
} | ||
.padding(.bottom, 76) | ||
.onAppear { | ||
presenter.onAppear() | ||
} | ||
} | ||
.navigationTitle("Configuration") | ||
.navigationBarTitleDisplayMode(.inline) | ||
.toolbarColorScheme(.dark, for: .navigationBar) | ||
.toolbarBackground(.visible, for: .navigationBar) | ||
.toolbarBackground( | ||
Color(red: 25/255, green: 26/255, blue: 26/255), | ||
for: .navigationBar | ||
) | ||
} | ||
} | ||
} | ||
|
||
struct ConfigView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ConfigView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.