element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Configure link to define custom homeserver/identity server automatically from `https://app.element.io/mobile_guide/` does not work (`mobile.element.io`)

Open MadLittleMods opened this issue 4 years ago • 13 comments

Steps to reproduce

  1. Have Element Android installed and signed out
  2. Visit https://app.element.io/mobile_guide/
  3. Click the Configure button
  4. Notice how it just redirects to https://mobile.element.io/?hs_url=https%3A%2F%2Fmatrix-client.matrix.org%2F&is_url=https%3A%2F%2Fvector.im%2F instead of being handled by the Android app

With Element Android installed on the sign in screen.

Press configure Just redirects me to mobile.element.io and pressing "Try again" does nothing

Outcome

What did you expect?

The Android app opens with the custom homeserver and identity server filled in

What happened instead?

Just redirects to https://mobile.element.io/?hs_url=https%3A%2F%2Fmatrix-client.matrix.org%2F&is_url=https%3A%2F%2Fvector.im%2F which tells me to update my app (which is already the latest) and try again which also does nothing.

Your phone model

Pixel 4a

Operating system version

Android 12

Application version and app store

Element version 1.4.11

Homeserver

matrix.org

Will you send logs?

No

MadLittleMods avatar Apr 12 '22 19:04 MadLittleMods

we should be capturing this url :thinking: https://github.com/vector-im/element-android/blob/develop/vector/src/main/AndroidManifest.xml#L210

<intent-filter>
	<data android:scheme="https" />
	<data android:host="riot.im" />
	<data android:host="app.element.io" />
	<data android:host="mobile.element.io" />
	<data android:host="develop.element.io" />
	<data android:host="staging.element.io" />
</intent-filter>

ouchadam avatar Apr 13 '22 08:04 ouchadam

@ouchadam to check if this has been completed already

daniellekirkwood avatar May 31 '22 13:05 daniellekirkwood

I can confirm mobile.element.io deeplink were fixed with https://github.com/vector-im/element-android/pull/6036

ouchadam avatar May 31 '22 14:05 ouchadam

@ouchadam This still does not work for me (same as issue description), Element Android 1.4.16

MadLittleMods avatar May 31 '22 20:05 MadLittleMods

this is strange :thinking: you're not getting an intent selection popup, perhaps in the past you've elected to always use chrome to handle links? you can clear the defaults by going to the chrome app android information > open by default > clear

REGISTER LOG IN WITH FTUE FLAGS DISABLED
mobile_guide_deeplink mobile_guide_sign_in deeplink_without_flags

ouchadam avatar Jun 01 '22 08:06 ouchadam

@ouchadam I don't think the intent is registered at all for me. Element doesn't have any links in its open by default settings.

Chrome doesn't have any open by default settings.

Element Open by default settings Holding on the Configure link doesn't give me the open with options

MadLittleMods avatar Jun 01 '22 08:06 MadLittleMods

ah it looks like we're hitting the web intent change in android 12 https://developer.android.com/about/versions/12/behavior-changes-all#web-intent-resolution

we'll need element.io to host a https://element.io/.well-known/assetlinks.json to confirm the Element app is approved to handle the url links

ouchadam avatar Jun 01 '22 08:06 ouchadam

Hello. As someone not familiar with open source, can you clue me in on the timeline where this deep-link functionality will work on Android?

Would love to deploy Element for our organization, and giving users a link that pre-fills the home server is going to be a must (the users are low-tech)

I don't mean this to sound demanding, just wondering if someone can decipher the activity here and let me know if an ETA to release is known.

Thank you

davidrtlt avatar Sep 02 '22 05:09 davidrtlt

@davidrtlt The PR to fix this, https://github.com/vector-im/element-android/pull/6225, is currently waiting on a change to element.io itself (it needs /.well-known/assetlinks.json to be present) which the Ops team needs to tackle, https://github.com/vector-im/sre-internal/issues/1382 (internal link). There is no ETA on when that change will happen.

MadLittleMods avatar Sep 02 '22 16:09 MadLittleMods

@MadLittleMods thanks for the insight. Do you know if there is a workaround, or another way, to getting the home server prefilled for new users?

davidrtlt avatar Sep 02 '22 18:09 davidrtlt

@davidrtlt You can setup /.well-known/matrix/client on your own homeserver, https://spec.matrix.org/v1.1/client-server-api/#well-known-uri

Client Server discovery (/.well-known/matrix/client) -- assists programs that you use to connect to your server (e.g. Element), so that they can make it more convenient for you by automatically configuring the "Homeserver URL" and "Identity Server URL" addresses. Learn more in Introduction to Client Server Discovery

-- https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md

It's the first time that I'm looking at it or knowing about it so I don't have more details than those docs. For example, I don't know if Element Android supports it.

MadLittleMods avatar Sep 02 '22 18:09 MadLittleMods

@MadLittleMods I really appreciate you pointing me in this direction. I will try this out. Have a wonderful weekend.

davidrtlt avatar Sep 02 '22 19:09 davidrtlt

Can you give an ETA for when this will be fixed?

Currently only element.io is serving the assetlinks.json file. However, for deep linking to work correctly, at least the following domains must also serve the file:

  • mobile.element.io
  • app.element.io
  • matrix.to

Other URLs that are registered but not verified by the Element Android app:

  • staging.element.io
  • develop.element.io
  • riot.im

This is a showstopper for our userbase, as autoconfiguration via link/qr code is a huge relief for less tech-savvy users.

albanbruder avatar Feb 05 '24 09:02 albanbruder