RootSoft / walletconnect-dart-sdk

Open protocol for connecting dApps to mobile wallets with QR code scanning or deep linking.
MIT License
104 stars 61 forks source link

Listeners don't work on Web #88

Open vcoolish opened 1 year ago

vcoolish commented 1 year ago

Session events are not coming if I use mobile linking in Web App. Web doesn't support websocket in background. Is there any workaround?

RootSoft commented 1 year ago

I don't see to have any problems on my web dapp example: https://sooq.art. Can you elaborate a bit more? Is this only on ios? (there's a lot of background restrictions issues over there)

vcoolish commented 1 year ago

Yes, this happens on iOS only, mostly issue in Safari. Chrome works time to time. So when you open wallet and confirm signature it send response back, and if it happens when browser in background, when you return to browser the response from wallet never comes. Works on android app and web

w4-jake commented 1 year ago

We also have been seeing a similar issue on web in iOS Safari, with iOS Chrome working sometimes!

In the case of iOS Safari, following instructions such as these have worked to keep the WebSocket connection open. But of course this is only a workaround for now.

It seems the issue starts with iOS 15 and up. A different device I have tried on with iOS 12 works fine without changing any default settings.

Here is some more relevant information: https://github.com/WalletConnect/web3modal/issues/334