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

feat: add deeplink to service #1344

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

SpecialAro
Copy link
Member

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

Enables activating a service by using ferdium://service/:serviceId

Motivation and Context

This PR fixes #1243. In the future, It would be interesting to also handle ferdium://service/:serviceName and present the user with different options if there is more than one recipe with the same name

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes
  • I tested/previewed my changes locally

Release Notes

notes: Added feature for activating a service from deep link using the service id.

@SpecialAro SpecialAro requested a review from a team as a code owner September 3, 2023 16:30
@SpecialAro SpecialAro self-assigned this Sep 3, 2023
@vraravam
Copy link
Contributor

vraravam commented Sep 3, 2023

Very nice if this works @SpecialAro !

@SpecialAro
Copy link
Member Author

Very nice if this works @SpecialAro !

I've tested on my macOS (had to build the app to test, as ferdium-dev protocol was opening an Electron window that was not ferdium) but it worked!

The downside is having to call the serviceId and not the name of a service 🥲 but in the future maybe we can improve this with a better logic

@SpecialAro SpecialAro merged commit 970738c into ferdium:develop Sep 3, 2023
@SpecialAro SpecialAro deleted the deep-link-service branch September 3, 2023 23:02
@ylluminate
Copy link

This looks really interesting. Can you give us some use-cases and examples for a more clear picture and various scenarios?

@KrystianLesniak
Copy link

KrystianLesniak commented Sep 4, 2023

I am testing this feature on 6.5.0-nightly6 and unfortunately at first glance it does not seem to work on Windows 11 x64.

For example, results from ferdium://service/gmail or ferdium://service/:gmail show a blank purple screen when the application is already running:
image

If the application is not currently running, deeplink will just start the application without running the specified service. It will show the first service just like normal startup.

This is my first experience with this feature, when I have some more time I will create full issue at repository describing problem.

@Alphrag
Copy link
Member

Alphrag commented Sep 4, 2023

For example, results from ferdium://service/gmail or ferdium://service/:gmail show a blank purple screen when the application is already running:

@KrystianLesniak Thanks for trying it. As mentioned by @SpecialAro above:

The downside is having to call the serviceId and not the name of a service 🥲 but in the future maybe we can improve this with a better logic

this means that you would need to call the url with the full serviceId, which is something that looks like d8d5eeb9-36be-4ec7-9ac7-d4abdfdabf01 (this for example is mine for Discord). Thus, I would need to call ferdium://service/d8d5eeb9-36be-4ec7-9ac7-d4abdfdabf01 instead of ferdium://service/discord.
I don't know what is the best way to find the values of the serviceId, but a good one is to go into the menu and click on Help -> Import/Export Configuration Data in order to export the .ferdium-data file. This is a json file which for each of your service contains the name, serviceId and other settings associated to it.

@KrystianLesniak
Copy link

Got it! I've referenced to "id" from these documents:
https://github.com/ferdium/ferdium-recipes/blob/main/docs/integration.md
https://github.com/ferdium/ferdium-recipes/blob/main/docs/configuration.md

That's why I misunderstood what "id" property is. I will try it later, thanks!

@SpecialAro
Copy link
Member Author

SpecialAro commented Sep 4, 2023

Hey!

Thank you @Alphrag for clarifying! That is indeed what I meant.

Nevertheless, I'll try to implement the ferdium://service/:recipeId (e.g. ferdium://service/gmail) in the future. But, as I said, we have to probably handle a logic if a user has more than 1 service with the same recipe id...

@SpecialAro
Copy link
Member Author

Got it! I've referenced to "id" from these documents:

Indeed does documents refer to a Recipe Id (which would be used in the approach that I just written). I'll try to make a simple approach that activates the first service and then we can think of improving it.

@KrystianLesniak
Copy link

I've quickly tested with correct service Id exported from .ferdium-data file and unfortunately the same issues as mentioned above happens.

So it's just launching application without changing to correct service or blank purple screen when application is already launched.

@SpecialAro
Copy link
Member Author

SpecialAro commented Sep 4, 2023

I've quickly tested with correct service Id exported from .ferdium-data file and unfortunately the same issues as mentioned above happens.

So it's just launching application without changing to correct service or blank purple screen when application is already launched.

I just noticed a bug. You are using Windows, am I right? I bet @Alphrag used macOS (as I did when coding - but now just tested with windows)

basically windows is adding a string with "--allow-file-access-from-files" for some reason... causing it to crash:
image

@KrystianLesniak
Copy link

I've quickly tested with correct service Id exported from .ferdium-data file and unfortunately the same issues as mentioned above happens.
So it's just launching application without changing to correct service or blank purple screen when application is already launched.

I just noticed a bug. You are using Windows, am I right? I bet @Alphrag used macOS (as I did when coding - but now just tested with windows)

basically windows is adding a string with "--allow-file-access-from-files" for some reason... causing it to crash: image

Yes, bug occurs at Windows 11 x64. Great and quick bug source finding @SpecialAro !

@Alphrag
Copy link
Member

Alphrag commented Sep 4, 2023

I just noticed a bug. You are using Windows, am I right? I bet @Alphrag used macOS (as I did when coding - but now just tested with windows)

Yeah I've tested it on mac, and doing something like open ferdium://service/d8d5eeb9-36be-4ec7-9ac7-d4abdfdabf01 works perfectly. Now I've also tried with my AppImage on windows using xdg-open but this launches Ferdium as usual and discards the link

SpecialAro added a commit to SpecialAro/ferdium-app that referenced this pull request Oct 3, 2023
Alphrag pushed a commit to Alphrag/ferdium-app that referenced this pull request Oct 14, 2023
@KrystianLesniak
Copy link

I've quickly tested with correct service Id exported from .ferdium-data file and unfortunately the same issues as mentioned above happens.
So it's just launching application without changing to correct service or blank purple screen when application is already launched.

I just noticed a bug. You are using Windows, am I right? I bet @Alphrag used macOS (as I did when coding - but now just tested with windows)

basically windows is adding a string with "--allow-file-access-from-files" for some reason... causing it to crash: image

Hello everyone.
Sorry to bother you in closed PR, but it is hard for me to dig through countless changelogs. Do you know if it is fixed yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to force Ferdium to activate a specified service?
5 participants