Wallet Connect v.2 - Swift
Swift 版本的 WalletConnect v.2 协议,适用于原生 iOS 应用程序。
需求
- iOS 13
- XCode 13
- Swift 5
文档和用法
- 在 XCode 中构建 API 文档,请前往 Product -> Build Documentation
- 钱包集成入门指南
- 为 iOS 开发者提供的WalletConnect v2.0 初学者指南
- 协议文档
- 术语表
- 从 Sign and Auth 迁移到 Web3Wallet 的迁移指南
安装
Swift包管理器
在您的Package.swift中添加 .package(url:_:)
dependencies: [
.package(url: "https://github.com/WalletConnect/WalletConnectSwiftV2", .branch("main")),
],
CocoaPods
将pod添加到Podfile中
pod 'WalletConnectSwiftV2'
如果在安装包时遇到任何问题,您可以指定存储库的精确路径
pod 'WalletConnectSwiftV2', :git => 'https://github.com/WalletConnect/WalletConnectSwiftV2.git', :tag => '1.0.5'
设置项目ID
根据Configuration.xcconfig中的说明,使用从WalletConnect仪表板获取的ID配置PROJECT_ID
// Uncomment next line and paste your project id. Get this on: https://cloud.walletconnect.com/sign-in
// PROJECT_ID = YOUR_PROJECT_ID
// To use Push Notifications on the Simulator you need to grab the simulator identifier
// from Window->Devices and Simulators->Simulator you're using->Identifier
SIMULATOR_IDENTIFIER = YOUR_SIMULATOR_IDENTIFIER
示例应用
打开 Example/ExampleApp.xcodeproj
Web3Wallet
Web3Wallet SDK引入了一个新的接口,用于封装签名和认证客户端。
许可证
Apache 2.0