Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to MetaMask rarely works #79

Open
BrettRosen opened this issue Oct 19, 2021 · 13 comments
Open

Connecting to MetaMask rarely works #79

BrettRosen opened this issue Oct 19, 2021 · 13 comments
Labels
question Further information is requested wallets

Comments

@BrettRosen
Copy link

Using bridgeURL - https://safe-walletconnect.gnosis.io and metamask deep link https://metamask.app.link/wc?uri=wc yet MetaMask mobile rarely opens the prompt to allow permission to connect. It seems to be flaky and works less than it doesn't. Whats going on

@ghost
Copy link

ghost commented Oct 19, 2021

Same here. I don't know why the example ios app doesn't work whereas android example apps work fine. I think we must request the developer to publish an updated code so that our issues are resolved instead of transferring to other apps code or redirecting to other threads. I am stuck at same from last week and the response everytime is to look : https://github.com/gnosis/safe-ios/blob/40a50dc8e6b3c007c8b3279cab0c202bef06d4a1/Multisig/UI/WalletConnect/WalletConnectServerController.swift

@BrettRosen
Copy link
Author

Same here. I don't know why the example ios app doesn't work whereas android example apps work fine. I think we must request the developer to publish an updated code so that our issues are resolved instead of transferring to other apps code or redirecting to other threads. I am stuck at same from last week and the response everytime is to look : https://github.com/gnosis/safe-ios/blob/40a50dc8e6b3c007c8b3279cab0c202bef06d4a1/Multisig/UI/WalletConnect/WalletConnectServerController.swift

This might actually be a bug with metamask as I noticed it stopped letting me view WalletConnect sessions within the app settings without crashing out. Resintalling and trying to connect has seemed to fix it for now? Fwiw walletconnect + rainbow works just fine

@ghost
Copy link

ghost commented Oct 19, 2021

Can you share the code screenshot or something?

@kohlivarun5
Copy link

Same here. I don't know why the example ios app doesn't work whereas android example apps work fine. I think we must request the developer to publish an updated code so that our issues are resolved instead of transferring to other apps code or redirecting to other threads. I am stuck at same from last week and the response everytime is to look : https://github.com/gnosis/safe-ios/blob/40a50dc8e6b3c007c8b3279cab0c202bef06d4a1/Multisig/UI/WalletConnect/WalletConnectServerController.swift

This might actually be a bug with metamask as I noticed it stopped letting me view WalletConnect sessions within the app settings without crashing out. Resintalling and trying to connect has seemed to fix it for now? Fwiw walletconnect + rainbow works just fine

I do think it is some MetaMask issue. Trust wallet also works very well

@ljs19923
Copy link

ljs19923 commented Dec 1, 2021

Hey do you have news about that?

@peywen
Copy link

peywen commented Dec 5, 2021

Cannot connect with MetaMask either. WIth metamask deep link https://metamask.app.link/ and bridge url https://c.bridge.walletconnect.org/, I can rarely see a prompt from metamask app.

@dustfire
Copy link

any solutions here?

@hungMta
Copy link

hungMta commented Jan 7, 2022

I know why the authentication popup in metamask isn't show. Because of deeplink format.
in the example. they're using wcUrl.absoluteString
let's take a look:

    public var absoluteString: String {
        let bridge = bridgeURL.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""
        return "wc:\(topic)@\(version)?bridge=\(bridge)&key=\(key)"
    }

this function just encodes bridgeURL and I compared absoluteString to deeplink in WalletConnect popup in browser that encoded whole data so I have to add some encoding actions. Specifically, I encode 2 characters "=" and "&"

        let connectionUrl = walletConnect.connect()
        let _encodeURL = connectionUrl.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""
        let _end2 = _encodeURL.replacingOccurrences(of: "=", with: "%3D").replacingOccurrences(of: "&", with: "%26")

         let metamaskLink = "https://metamask.app.link/wc?uri="
         let deepLinkUrl = "\(metamaskLink)\(_end2)"
       ....

Now, I can see an authentication popup in metamask all the time

@kohlivarun5
Copy link

absoluteString

Thanks @hungMta, your change does indeed work and I am able to now connect to MetaMask consistently.
For reference, this is a code change on my side:
https://github.com/kohlivarun5/nfty/pull/246/files#diff-fe7bd9e77510ff56365962e715a1a4d1c2d9183048a39c050b309387d9da648fR92

@hungMta
Copy link

hungMta commented Jan 10, 2022

@mazenkourouche maybe the problem is your bridge server. You can try https://safe-walletconnect.gnosis.io/. It's worked for me

@scottandrew
Copy link

I can't seem to get the sample to work at all. I have been trying for a while. It bounces to Metamask but I am not getting asked to connect..

@nenadvulic
Copy link

it's like the connection was broke since the last metamaks app update. can you any confirm that ?

@maurovz
Copy link

maurovz commented May 12, 2022

absoluteString

Thanks @hungMta, your change does indeed work and I am able to now connect to MetaMask consistently. For reference, this is a code change on my side: https://github.com/kohlivarun5/nfty/pull/246/files#diff-fe7bd9e77510ff56365962e715a1a4d1c2d9183048a39c050b309387d9da648fR92

Looks like you have a pretty good setup for your wallets. I'm going to follow your example.

@DmitryBespalov DmitryBespalov added question Further information is requested wallets labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wallets
Projects
None yet
Development

No branches or pull requests

11 participants