Skip to content
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

open link to a deck board/card directly in the deck app #498

Open
1 of 3 tasks
jakobroehrl opened this issue May 14, 2020 · 17 comments
Open
1 of 3 tasks

open link to a deck board/card directly in the deck app #498

jakobroehrl opened this issue May 14, 2020 · 17 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jakobroehrl
Copy link

jakobroehrl commented May 14, 2020

Is your feature request related to a problem? Please describe.
If I click on a deck link the browser pops up

Describe the solution you'd like
Open it directly in the deck app
It's working for the android file app and it's super convenient:
nextcloud/android#5345

ToDo

@jakobroehrl jakobroehrl added the enhancement New feature or request label May 14, 2020
@stefan-niedermann
Copy link
Owner

If i understood you correct, the link must propose to open links beginning with the protocol nc:// followed by directlink/ plus for example deck/5/list/4/card3. So for example a link that gets opened by deck is:

nc://directlink/deck/5/list/4/card/3

This is possible, but who uses this kind of link? The greates user experience would be to detect a link with the part [...]/index.php/apps/deck/[...] and try to parse it. Unfortunately i don't know a way to achieve this because in our scenario the hostname is variable and we do not have a custom protocol.

Therefore your proposed solution would work but, well, where are such links used?

@jakobroehrl
Copy link
Author

I don't know how to solve it, but I think if User A sends a board or card link to User B via Chat or Mail and User B opens the link on mobile it would be nice if the deck app opens an not the browser.

@stefan-niedermann
Copy link
Owner

🤷‍♂️ Maybe one can create intent-filters dynamically at runtime (when we know the hosts).

Any help, hints and PRs appreciated.

@stefan-niedermann stefan-niedermann added the help wanted Extra attention is needed label May 16, 2020
@szaimen

This comment has been minimized.

@stefan-niedermann
Copy link
Owner

interesting. Will this not open a app chooser everytime one clicks any link?

@szaimen
Copy link

szaimen commented May 20, 2020

interesting. Will this not open a app chooser everytime one clicks any link?

No, because it will only open the app chooser if the pattern matches, which is the pattern that you told him to look for: in this case the link must be a http or https link and contain /index.php/apps/deck/ or /apps/deck/

@stefan-niedermann
Copy link
Owner

Aah, i got it. Will have a look at it, thanks for the hint!

@szaimen
Copy link

szaimen commented May 20, 2020

btw: links from the deck app seems to contain always the following: /apps/deck/#/
So you could probably expand the pattern that I've suggested from ".*/apps/deck/.*" to ".*/apps/deck/#/.*"

But you should make sure that all links contain that pattern yourself.

@szaimen
Copy link

szaimen commented May 20, 2020

Actually, to make it also in multiuser-environments right, the following is maybe helpful:
nextcloud/android#5345 (comment)

Although I have to say, that point 4 and 5 were differently implemented: the app always presents an account chooser, if more than one account matching the domain was found.

And point 3 wasn't completely implemented: it doesn't open the browser if no username was found matching the domain. There was a discussion about it, but it was decided to not implement it in this PR:
nextcloud/android#5345 (comment)

Instead of opening the link in the browser, you could also decide to ask the user, if they want to create an account...

@stefan-niedermann
Copy link
Owner

  • If no user matches the account, open link in browser
  • Else: Synchronize all boards of the given user lists from this host
    • If no user has permission to access to this board / card, open link in browser
    • Else if only one user has access to this board / card, open it in the app
    • Else if multiple users have access to this board / card, display an account chooser from which view this board / card should be opened

The sync step is necessary in order to make sure that the board hasn't shared recently with the user.

I would handle it similar to receiving push notifications: We open an activity with a button "Open in browser" and a disabled button "Open in app" which gets only enabled as soon as we are sure we have a user with access permission.

@szaimen

This comment has been minimized.

@stefan-niedermann

This comment has been minimized.

@szaimen
Copy link

szaimen commented May 20, 2020

actually this wouldn't work:

<data android:scheme="http"
  android:scheme="https"
  android:host="*"
  android:pathPattern=".*/apps/deck/.*"
  />

What will work though is:

<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/.*apps/deck/..*" />

@desperateCoder
Copy link
Collaborator

I think I'm done here, but I couln't test it yet (no UI). If it dies, just tell, gonna be fixed.

@stefan-niedermann
Copy link
Owner

Okay, i think i have a proof of concept in PR #563
Though there are some issues left (see linked PR), help would be appreciated.

@mstyp
Copy link

mstyp commented Aug 3, 2022

Wait, so, is this supposed to be working or not? If i get a notification with nextcloud services with a link to the relevant card, should that link be opening the deck app? because right now its just opening firefox.

I've been really struggling with lack of notifications for deck and this would solve my issue.

@stefan-niedermann
Copy link
Owner

Since this is still an open Pull Request, this has not been merged yet and is therefore not supposed to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants