nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.3k stars 1.77k forks source link

Option to open direct links in the app #2562

Closed juliusknorr closed 4 years ago

juliusknorr commented 6 years ago

Actual behaviour

Expected behaviour

I'm not sure if this is somehow possible on android, since Nextcloud instances are hosted on custom domains, but maybe someone from @nextcloud/android has an idea. Maybe we could extend the web ui with some button like "Show in the client" that is shown on mobile and calls some custom url like: nc://directlink/https://cloud.example.com/f/12345

ardevd commented 6 years ago

Great idea. But yeah, it would probably require server side changes to produce filterable URLs.

The only other alternative I can think of would be to subscribe to all http-links and prompt the user to open the link with the app but that's not a very elegant solution.

AndyScherzinger commented 6 years ago

Like @juliushaertl and @ardevd stated, yes, we would need a custom URL generated by the server for which we would register as a VIEW since registering on any URL would be bad UX since we can't handle most of them.

Original discussion about this is #1069

rullzer commented 6 years ago

Is there a way to detect in the browser if there is protocol handler for nc:// ? because if so we could do

  1. open https://cloud.example.com/f/12345 in your browser
  2. we do some magic to detect if the the android app is installed
  3. If so open app with nc:// link if not just redirect to normal web view
tobiasKaminsky commented 6 years ago

This one is working for me: https://stackoverflow.com/a/32358608

We then could use nc://directlink/$url as @juliushaertl suggested. Of course the internal handling does not exist yet: We need to get info about location of passed file, then download all metadata from root to this file + parent folder. But it should be feasible.

@juliushaertl links which you receive via email will still be in http://cloud/f format, so those will not work. An automated email of course could show both.

juliusknorr commented 6 years ago

I also had an approach like @rullzer described in mind, so users can continue to share the https://cloud/f links but when they are opened on android and the app is installed it is possible to open the file in the app.

I'll have a look if I can get the detection on the server side work somehow.

tobiasKaminsky commented 6 years ago

As far as I know there is no way to get an info if a specific app is installed, which otherwise would be a big privacy issue as a bad website could try to detect all installed apps and use them for marketing, …

AndyScherzinger commented 6 years ago

As far as I know there is no way to get an info if a specific app is installed

Afaik like @tobiasKaminsky mentioned this isn't possible for the bowsers

tobiasKaminsky commented 5 years ago

We then could use nc://directlink/$url as @juliushaertl suggested. Of course the internal handling does not exist yet: We need to get info about location of passed file, then download all metadata from root to this file + parent folder. But it should be feasible.

So this is is done by me for #3933 and thus can also be used, with a minor change for this.

szaimen commented 4 years ago

Any update here? :)

AndyScherzinger commented 4 years ago

No.

jakobroehrl commented 4 years ago

@tobiasKaminsky https://github.com/nextcloud/android/issues/1069 could be closed, too?