-
Notifications
You must be signed in to change notification settings - Fork 107
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
Web Dapps Using Auto Sign Not Working with MWA #490
Comments
Update: further investigation has revealed that even properly verified links still exhibit this behavior so its not related to app link verification. |
Question: If my above theories are correct, why do some sites work but others dont? For example, Ultimate wallet does not work with drip.haus (see gif above), but it does work as expected with jup.ag. Is Jupiter using a custom implementation of mobile wallet adapter that works around this issue? Or am I incorrect in my assumptions and something else is causing some apps to navigate to the wallet url instead of launching it as an app link/android intent? |
This workaround was found to only work with some sites. Its not a reliable solution, and the solana-wallet:// uri can still be blocked by chromes popup blocker so the above info is not actually correct. Further investigation is needed to understand why some sites (like drip.haus) seem to work with this workaround. Their error logic might give us a clue on how to handle this case. |
Proposed Solution:
|
I would say that there are 2 things to implement here:
This is the naive approach, there is more to the solution proposed under the point 2. and it's implementation will probably take a lot of thought and time. The biggest issue would be the For example, if we want authorize a dApp and sign a message in a single wallet session on mobile web apps, our Roughly something like this: await transact(async (mobileWallet) => {
const freshAccount = await authorizeSession(mobileWallet)
const account = selectedAccount ?? freshAccount
if (typeof afterConnect === 'function') {
await afterConnect(mobileWallet, account)
}
}
On a side note, I don't think this issue has anything to do with the example app? That could be an issue of it's own, but shouldn't be this one since the example app does not use cc: @Funkatronics |
Describe the bug
Some dapps attempt to do a sign in flow by automatically triggering a message sign as soon as a wallet is connected. On Chrome for Android (and most if not all other mobile browsers), both app links (eg
solana-wallet://
) and universal links (eghttps://my.app/...
) are blocked if they do not come from a direct user action. This causes these sites to not funciton with Mobile Wallet Adapter. The sign message attempt is blocked, and in most cases this causes the site to get stuck in a sort of infinite loop because a cookie is stored for the connected wallet (reload>connected wallet is saved and reconnects>triggers auto sign message again>blocked>reload>repeat).To Reproduce
Steps to reproduce the behavior:
{walletUriBase}/v1/associate/...
{walletUriBase}/v1/associate/...
Note:
Expected behavior
Upon returning to the webpage after approving the connection in the wallet app, subsequent requests sent to the wallet should function as expected (launch the wallet app and continue with MWA request as usual)
Screenshots
Using drip.haus and Ultimate:
Using drip.haus and Fakewallet:
Using example web app and Fakewallet:
Smartphone (please complete the following information):
Additional context
This was confirmed to be false. The issue is almost certainly due to mobile browsers blocking navigation (app links, universal links) that do not originate from a user action (popup blocking).
The text was updated successfully, but these errors were encountered: