Skip to main content

Upgrade from Web3Modal to Reown AppKit for Android

This upgrade guide helps developers transition from using the Web3Modal library to the AppKit within reown-kotlin. The upgrade involves updating imports, modifying class references and updating artefacts dependencies. Follow these steps to ensure a smooth migration.

Step 1. Update the Repository Dependencies

The Web3Modal library has been deprecated and moved to a new repository under the reown-com organization. Update your dependencies to use AppKit:

- dependencies {
- implementation(platform("com.walletconnect:android-bom:{BOM version}"))
- implementation("com.walletconnect:android-core")
- implementation("com.walletconnect:web3modal")
- }
+ dependencies {
+ implementation(platform("com.reown:android-bom:{BOM version}"))
+ implementation("com.reown:android-core")
+ implementation("com.reown:appkit")
+ }

Step 2. Update Imports in Your Code

All references to Web3Modal in your import statements should be updated to use AppKit.

- import com.walletconnect.android.*
- import com.walletconnect.web3.modal.*
+ import com.reown.android.*
+ import com.reown.appkit.*

Step 3. Update Class Name

The singleton instance for Web3Modal has been replaced with AppKit. Update all instances where Web3Modal is used with AppKit.

- Web3Modal.initialize(Wallet.Params.Init(core = CoreClient), onSuccess, onError)
- Web3Modal.request(request, onSuccess, onError)
+ AppKit.initialize(Wallet.Params.Init(core = CoreClient), onSuccess, onError)
+ AppKit.request(request, onSuccess, onError)

Step 4. Update ProGuard file rules

If you have ProGuard rules defined remember to update them

- -keep class com.walletconnect.web3.modal.client.Wallet$Model { *; }
- -keep class com.walletconnect.web3.modal.client.Wallet { *; }
+ -keep class com.reown.appkit.client.Wallet$Model { *; }
+ -keep class com.reown.appkit.client.Wallet { *; }

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.