MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.15k stars 1.11k forks source link

How do I set the metamask app to redirect back to a PWA after metamask wallet is connected via deeplink #8055

Closed tycooperaow closed 10 months ago

tycooperaow commented 10 months ago

What is this about?

I am trying to simulate this experience. https://github.com/MetaMask/metamask-mobile/assets/35544142/3c3e2508-581c-4622-90d4-0270f257cbd6

This app uses web3auth, but I prefer not to use them and allow users to confirm their metamask through a deep link.

I have the deeplink part set up as: window.location.href = 'https://metamask.app.link/dapp/strmline.co/pass;' but the only issue becomes that the link opens within metamask browser not open back to the PWA. It also does not prompt the user to confirm their wallet either, any tips?

Scenario

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

No response

Stakeholder review needed before the work gets merged

References

No response

christopherferreira9 commented 10 months ago

Hi @tycooperaow ! Are you trying to open the MetaMask inapp browser to connect the user? If so, you won't be able to direct the user back to your dapp. This is an awesome scenario to use the MetaMask SDK. Take a look at it and feel free to report any issues you encounter on that repository.