WalletConnect / WalletConnectKotlinV2

WalletConnect Kotlin SDK v2
Apache License 2.0
199 stars 71 forks source link

Redirection from Wallet to Dapp not happening in case of WalletConnectModal.request #1117

Open prabhat-oodles opened 1 year ago

prabhat-oodles commented 1 year ago

Describe the bug Doesn't redirect back to Dapp after accepting or rejecting custom request (eth_sendTransaction) with Request params. Here is the code that I am using:

        val topic = // topic
        val params  = // params
        WalletConnectModal.request(
            request = Modal.Params.Request(
                sessionTopic= topic,
                method = "eth_sendTransaction",
                params = params,
                chainId = "eip155:3602"
            ),
            onSuccess = {
                WalletConnectModal.getActiveSessionByTopic(topic)?.redirect
                    ?.let { deepLinkUri ->
                        scope.launch {
                            val intent = Intent(Intent.ACTION_VIEW).apply {
                                data = deepLinkUri.toUri()
                            }
                            activity.startActivity(intent)
                        }
                    }
            },
            onError = {
                // log error
            }
        )

SDK Version

To Reproduce Steps to reproduce the behavior:

  1. Intialize the wallet connect CoreClient
  2. Send a session proposal and approve from the wallet app.
  3. Send "eth_sendTransaction" request with required details.
  4. Approve / Reject the request from wallet.
  5. App does not redirects to Dapp.

Expected behavior A redirection should happen from Walelt to Dapp after request approval or rejection.

kacperoak commented 1 year ago

What wallet do you use?

prabhat-oodles commented 1 year ago

What wallet do you use?

@kacperoak I used MetaMask wallet.

kacperoak commented 1 year ago

@prabhat-oodles Have you added a deeplink to your AndroidManifest.xml?

prabhat-oodles commented 1 year ago

@prabhat-oodles Have you added a deeplink to your AndroidManifest.xml?

Yes @kacperoak , I have added the deeplink in my AndroidManifest

kacperoak commented 1 year ago

I tested it and agree with you, metamask sometimes doesn't redirect back to Dapp. I have also tried other wallets and they seem to work fine.

Can you tell me if it works for you with other wallets? it's possible that it's an issue of the metamask wallet.

SevenBitsRashmi commented 11 months ago

Do we have any update on this issue?

kacperoak commented 11 months ago

I tested this issue several times with multiple wallets apps. The redirect problem is releated to the metamask wallet app. You can add this issue to them: https://github.com/MetaMask/metamask-mobile