alpha-wallet-android icon indicating copy to clipboard operation
alpha-wallet-android copied to clipboard

Universal link with embedded URL doesn't work

Open hboon opened this issue 3 years ago • 16 comments

Hi guys, thank you for implementing the deep link feature. I tested it for our palm dapp and it worked well on iOS! But when I tried it on my Android phone it didn't work as expected. The link that I was testing looked like this: https://aw.app/openurl?url=http%3A%2F%2Fa3f6-64-231-104-180.ngrok.io Here are the screenshots for Android (Samsung Galaxy A12):

- -

I tried Chrome and the built-in Samsung browser. AlphaWallet version: 3.51.0 (180)

hboon avatar Feb 14 '22 06:02 hboon

This is fixed but not yet in the release build. Once the erc721 patch is fully tested and merged we'll do a release candidate build

JamesSmartCell avatar Feb 14 '22 15:02 JamesSmartCell

With v3.5.2 RC1:

  1. Visit https://s.hboon.repl.co in a web browser (not in AlphaWallet app)
  2. Tap on any of the links "Universal link to open dapp", "Foo1" or "Foo2"

Expected:

  1. Switch to AlphaWallet app and automatically open the embedded URL in the browser (tap https://aw.app/openurl?url=http%3A%2F%2Fapp.uniswap.org%3Ftest%3Dvalue1 should open http://app.uniswap.org?test=value1)

Observed:

  1. 3 Screenshots
- - -

hboon avatar Feb 28 '22 07:02 hboon

@hboon works for me:

https://user-images.githubusercontent.com/12689544/156117608-a123c84d-c067-45ca-8bf7-a22e2cdd8d31.mp4

Testest with Samsung, Chrome, Brave and Duck Duck Go. Brave shown. Seems to work correctly.

JamesSmartCell avatar Mar 01 '22 06:03 JamesSmartCell

@JamesSmartCell I couldn't catch it, how does it go from:

Screenshot 2022-03-01 at 2 59 38 PM

to:

Screenshot 2022-03-01 at 2 59 34 PM

is it automatic?

And does all 3 links "Universal link to open dapp", "Foo1" and "Foo2" work this way for you?

hboon avatar Mar 01 '22 07:03 hboon

I had to push a fix through for when AW isn't already loaded (intents get processed before the 4 main screen fragments are initialised so you need a delayed load). But yes it works correctly for all cases. Can you try using the Samsung browser or Chrome? It actually worked in all 6 browsers I use (Samsung, Edge, Brave, Firefox, DuckDuckGo, Chrome), albeit with slightly different UI.

Here's a demo with Samsung browser, with AW paged out before each load:

https://user-images.githubusercontent.com/12689544/156216955-5a9cad42-92d8-48f0-9c94-0ea9feb1d5e3.mp4

I'll do another build as I think I fixed Tomek's crashing issue too.

JamesSmartCell avatar Mar 01 '22 17:03 JamesSmartCell

@hboon This is all done through intents in the Manifest - you register an intent with Android OS that you want this app to be a possible recipient of any URL beginning with "aw.app". If the user visits a URL like that, the OS will pick up that an app may handle it better than a browser and you see the AW icon in the intent popup. I'm not sure that's your question.

I don't know how intents work across all devices; but try an emulator. What device are you testing on? This intent system works correctly on all my test phones:

Samsung S20 (11) Xiaomi MiMix (10) Pixel 1 (11) Huawei (10) Emulator (Various)

JamesSmartCell avatar Mar 01 '22 17:03 JamesSmartCell

This combo works for me: Huawei + Chrome + newest build, but not with Huawei + built-in browser + newest build.

hboon avatar Mar 02 '22 04:03 hboon

@JamesSmartCell does it also work with the built-in Samsung browser? (mentioned in 1st comment)

hboon avatar Mar 02 '22 04:03 hboon

Yes, it works with Samsung browser on my S20.

JamesSmartCell avatar Mar 02 '22 04:03 JamesSmartCell

This combo works for me: Huawei + Chrome + newest build, but not with Huawei + built-in browser + newest build.

I don't have access to my Huawei but magic links used to work on it; and this uses the same set of manifests. I can test when I'm finally allowed to return home.

JamesSmartCell avatar Mar 02 '22 04:03 JamesSmartCell

I can reproduce it on my Huawei, let me figure it out.

seabornlee avatar Mar 23 '22 03:03 seabornlee

I tested on my Huawei phone.

  1. Default browser cannot open any links
  2. Firefox doesn't open links by default, Click Open in app menu item opens the link
  3. Edge browser open links automatically

I don't understand where does this error come from:

error: com.alphawallet.token.entity.SalesOrderMalformed: Invalid link format

Even I open it on Mac, it also shows the same error. I can find the class in Android repo https://github.com/AlphaWallet/alpha-wallet-android/blob/master/lib/src/main/java/com/alphawallet/token/entity/SalesOrderMalformed.java

Do we really have the domain aw.app and it respond the error?

seabornlee avatar Mar 23 '22 13:03 seabornlee

Do we really have the domain aw.app and it respond the error?

We do own the domain and use it for deeplinks.

hboon avatar Mar 23 '22 13:03 hboon

Do we really have the domain aw.app and it respond the error?

We do own the domain and use it for deeplinks.

Exactly, it redirects to alphawallet.com.

seabornlee avatar Mar 23 '22 13:03 seabornlee

This should be fixed by #2535 , for Android 12.

JamesSmartCell avatar Apr 11 '22 03:04 JamesSmartCell

@seabornlee should close this since it's fixed?

hboon avatar Mar 21 '23 23:03 hboon