phantom / deep-link-demo-app

179 stars 25 forks source link

Sometimes the phantom wallet prompt doesn't come out. #9

Closed dohankk closed 2 years ago

dohankk commented 2 years ago

When I use deep link in js window.open ( mobile browser -> mobile Phantom wallet ) first try make nvigation to Wallet. ( I can't get the prompt even if I wait. ) second try, A prompt is generated.

How can I get a prompt on my first try?

bfriel commented 2 years ago

Hi @dohankk can you share more information on what type of device you're using? Are you experiencing this while running this demo app?

dohankk commented 2 years ago

no, I made the web by referring to your app.

Using Samsung Galaxy S21, In Chrome browser When I Click Button, HTML execute window.open("deep link url")

like this code

const transfer_btn = document.querySelector('#transfer');

transfer_btn .onclick = () => {

...// get Params

const link = buildUrl("connect", params);

  window.open(link)
}
adamkasprowicz commented 2 years ago

Bug report

Android - Phantom Wallet doesn't show popup if you use the same deep-link twice

Test Scenario:

  1. Open MyApp (custom app that will create deep-links to Phantom Wallet)
  2. MyApp generates a deep-link to SignMessage method
  3. Phantom Wallet opens with a popup to approve & sign the message (here it works)
  4. User clicks Approve in the Phantom wallet
  5. Phantom Wallet redirects user to redirectUrl It leaves the Phantom Wallet app open
  6. MyApp opens with correct data (from redirectUrl/params)
  7. Now - MyApp generates another deep-link - for the same method - SignMessage
  8. Phantom Wallet opens without any popup (BUG)

Bonus:

  1. now, if you manually go back to MyApp and generate the deep-link once again
  2. Phantom Wallet opens with a popup (correct behaviour)

PS: The severity of this Bug for our application is quite high, we're looking forward for at least "medium" priority in your backlog please ;]

dohankk commented 2 years ago

3.1 When phantom Wallet is not running, open with pop-up

3.2 When phantom wallet is running, Frist try make no pop-up no matter how I long wait. pop-up will occur from the next try.

adamkasprowicz commented 2 years ago

maybe this will help: https://stackoverflow.com/questions/35931028/android-deep-link-does-not-work-if-the-app-is-opened-by-deep-link-already

please fix asap ^^

adamkasprowicz commented 2 years ago

if the solution posted above doesn't help

adamkasprowicz commented 2 years ago

@phantom devs please fix it asap - we have a Solana Hacker House demo day on Sunday I've found another hint how to fix it https://stackoverflow.com/questions/61480730/deeplink-isnt-correctly-redirect-if-the-app-is-already-opened

bfriel commented 2 years ago

Thanks for the heads up. We are still heads down on the drain investigation and won't be able to push a fix until work there has concluded. In the meantime, iOS deeplinks should work as expected.

https://twitter.com/BChillman/status/1555274059545382912

adamkasprowicz commented 2 years ago

Our hacker house's product demo was ok - we used the desktop version of Phantom (ext) If you want to see what happens in Android: https://www.tiktok.com/@fotami.com/video/7129795546478300421 when the bug is fixed, we'll replace these demo vids

lgh001 commented 2 years ago

Bug report

Android - Phantom Wallet doesn't show popup if you use the same deep-link twice

Test Scenario:

  1. Open MyApp (custom app that will create deep-links to Phantom Wallet)
  2. MyApp generates a deep-link to SignMessage method
  3. Phantom Wallet opens with a popup to approve & sign the message (here it works)
  4. User clicks Approve in the Phantom wallet
  5. Phantom Wallet redirects user to redirectUrl It leaves the Phantom Wallet app open
  6. MyApp opens with correct data (from redirectUrl/params)
  7. Now - MyApp generates another deep-link - for the same method - SignMessage
  8. Phantom Wallet opens without any popup (BUG)

Bonus: 9. now, if you manually go back to MyApp and generate the deep-link once again 10. Phantom Wallet opens with a popup (correct behaviour)

PS: The severity of this Bug for our application is quite high, we're looking forward for at least "medium" priority in your backlog please ;]

I have the same bug!!! Please fix it asap.

jokumusic commented 2 years ago

I have a little trick that makes things smoother, but doesn't completely fix it. You can try a rewrite of the demo @ https://github.com/jokumusic/phantom_deeplink_demo

It works best if Phantom wallet is closed before you click connect on the demo app. Once you click connect, Phantom app starts and you successfully connect, the other actions will succeed on first try. The one button that the trick doesn't seem to work for is the Send Memo button. For some reason, that deeplink breaks it.

Anyways, the gist of the trick is to call connect async before every call, but don't wait for it. Phantom seems to prioritize the call that comes after and that's the only one it will respond to when it receives multiple calls. For instance, you may see the connect popup show up for a split second, but the transaction call after that will pop up in front of it and that's the one Phantom will respect.

lempiy commented 2 years ago

Absolutely blocker bug, its impossible to use deeplinks feature without fix. UX for web mobile apps with phantom is currently horrible. Please take a look on it.

adamkasprowicz commented 2 years ago

Ok, I've just received an email - devs from Phantom fixed this problem and the fix gonna be shipped sooon ^^

Harry (Phantom Support) Aug 17, 2022, 23:54 CDT Hi again, We have fixed the issue and the next update to the android app will include the fix. Thank you for being patient and sorry for any inconvenience this may have caused

bfriel commented 2 years ago

The fix for this issue is now live! Please update your Android devices to v22.08.18 (90).