Upgrade from Web3Modal to Reown AppKit for iOS
This upgrade guide is intended to help developers transition their projects from using Web3Modal to the AppKit. The changes involve updating imports, modifying method calls, changing the repository URL for Swift Package Manager (SPM), and adjusting instance and configuration methods. Follow the steps below to migrate smoothly.
Step 1. Update the Repository URL
The Web3Modal project has moved from the WalletConnect organization to a new repository under the reown-com organization. If you are using Swift Package Manager (SPM) to manage dependencies, update your Package.swift file to point to the new repository:
- .package(url: "https://github.com/WalletConnect/web3modal-swift", from: "1.0.0"),
+ .package(url: "https://github.com/reown-com/reown-swift", from: "1.0.0"),
Step 2. Update Imports in Your Code
All references to Web3Modal in your import statements should be changed to AppKit.
- import Web3Modal
+ import AppKit
Step 3. Update Instance Access and Method Calls
The singleton instance access for Web3Modal has been replaced with AppKit. Update all instances where Web3Modal.instance is used to AppKit.instance.
- Web3Modal.instance.authResponsePublisher.sink { (id, result) in
- // Your code here
- }
+ AppKit.instance.authResponsePublisher.sink { (id, result) in
+ // Your code here
+ }
Step 4. Update Configuration Method
The configure method has also been updated to reflect the new branding. Replace calls to Web3Modal.configure with AppKit.configure. Old Configuration:
- Web3Modal.configure(
- ...
- )
+ AppKit.configure(
+ ...
+ )
Step 5. Test Your Changes
After updating all references to Web3Modal to use AppKit, thoroughly test your application to ensure that all functionalities work as expected.