MetaMask / metamask-sdk

The simplest yet most secure way to connect your blockchain-based applications to millions of MetaMask Wallet users.
https://metamask.io/sdk/
Other
171 stars 106 forks source link

[Bug]: Safari iOS: Unable to Connect within iframe after 0.27.0 Upgrade #973

Open andremfaria opened 1 month ago

andremfaria commented 1 month ago

SDK

Web

Provide environment information

web sdk-react 0.27.0 safari 17.4

MetaMask SDK Version

0.27.0

MetaMask Mobile app Version

7.27.0

What browser are you using? (if relevant)

Safari 17.4

How are you deploying your application? (if relevant)

web

Describe the Bug

With the new version 0.27.0, if we are using an iframe and hit sdk?.connect(), nothing happens. This behaviour occurs in Safari on iOS.

Video:

https://github.com/user-attachments/assets/8dcc9cb1-d27f-4ef6-88fc-2ad230cfcbbd

Expected Behavior

We should be able to connect on Safari@IOS within an Iframe.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/andremfaria/mm-iframe/

To Reproduce

  1. Run the Project: https://github.com/andremfaria/mm-iframe/

  2. Open Safari on iOS:

    • Ensure you are using an iOS device.
    • Open the Safari browser.
  3. Access the Local Server:

    • In Safari, navigate to http://<your-local-ip>:5173/iframe/index.html.
    • Replace <your-local-ip> with your actual local IP address.
  4. Trigger the Issue:

    • On the webpage, locate and click the "Connect" button.
christopherferreira9 commented 1 month ago

Hi @andremfaria ! Thank you for reporting! Are you doing pnpm run dev or pnpm run build + serve the built folder?

I can see it working with both options though:

https://github.com/user-attachments/assets/37c2267d-4705-4af4-b557-80dfbf7ad0f4

andremfaria commented 1 month ago

Hello @christopherferreira9, thanks for your feedback!

I noticed in your video that you're not using the iframe. Could you please test it on http://local-ip:port/iframe/index.html? The issue only happens when using an iframe.

christopherferreira9 commented 1 month ago

Hi @andremfaria ! You're right, got it to reproduce going into the proper route, I'm sorry for the confusion. Will escalate to investigate.

andremfaria commented 2 weeks ago

Hi @christopherferreira9, just an update: I tested with version 0.28.1, and the issue is still occurring.