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

Use https:// deep links instead of status-im:// - Windows #9549

Closed
Tracked by #12245 ...
endulab opened this issue Feb 15, 2023 · 14 comments · Fixed by #10778
Closed
Tracked by #12245 ...

Use https:// deep links instead of status-im:// - Windows #9549

endulab opened this issue Feb 15, 2023 · 14 comments · Fixed by #10778
Assignees
Labels
bug Something isn't working
Milestone

Comments

@endulab
Copy link
Contributor

endulab commented Feb 15, 2023

Related to #7957

Discussions in status-im/status-web#327

@endulab endulab added the bug Something isn't working label Feb 15, 2023
@endulab endulab added this to the 0.12.0 milestone Feb 15, 2023
This was referenced Feb 15, 2023
@felicio
Copy link

felicio commented Feb 15, 2023

@endulab please, could you add the following to description as one of acceptance criteria

  • test if passed https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret, platform can access both query parameters after ? as well as value after #

of


Platform Example URL Registration during install Approach
Linux https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret Use a .desktop file to associate the app with a custom URI scheme. The .desktop file can be placed in /usr/share/applications or ~/.local/share/applications. Use command-line arguments or X11 events to pass the URL to the running instance of the application. Extract the query parameters and fragment from the URL using a URI parsing library or regular expressions.
Windows https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret Add a registry key to associate the app with a custom URI scheme. The registry key can be added during the installation process using an installer or script. Use command-line arguments or the Windows registry to pass the URL to the running instance of the application. Extract the query parameters and fragment from the URL using a URI parsing library or regular expressions.
macOS https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret Define the custom URI scheme in the application's Info.plist file. The CFBundleURLTypes key in the Info.plist file specifies the URL schemes that the app can handle. Use AppleScript, the NSAppleEventManager API, or the CFBundleURLTypes key in the application's Info.plist file to handle the URL. Extract the query parameters and fragment from the URL using a URI parsing library or regular expressions.
iOS https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret Define the custom URI scheme in the application's Info.plist file. The LSApplicationQueriesSchemes key in the Info.plist file specifies the URL schemes that the app can handle. Use the UIApplicationDelegate method application(_:open:options:) to handle the URL. Extract the query parameters and fragment from the URL using the URLComponents class or regular expressions.
Android https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret Define an element in the application's manifest file to register the URL scheme. The element specifies the URL scheme and the activity that can handle the URL. Define an element in the application's manifest file to register the URL scheme. Use the getIntent method of the Activity class to extract the data from the intent object that started the activity. Extract the query parameters and fragment from the URL using the Uri class.

– source, ChatGPT

@jrainville jrainville modified the milestones: 0.12.0, 0.13 Apr 24, 2023
@jrainville jrainville moved this to In Progress in Status Desktop/Mobile Board May 9, 2023
@jrainville
Copy link
Member

Confirming that deep links still work on Windows.

Changing to https://

@jrainville
Copy link
Member

I tried using https://status-whetever in the registry and it doesn't work.
http and https are both already handled by Windows.

Unless I misunderstood the task, I don't think it's possible to make a deep link start with http(s) on Windows.

We can have status-im:// or status-app:// or anything like that though.

@felicio @endulab

@felicio
Copy link

felicio commented May 10, 2023

@jrainville thanks,

I don't think it's possible to make a deep link start with http(s) on Windows.

I'd say following supports your conclusion.

More than one app can register to handle the same URI scheme. The exception to this is for reserved URI schemes. Registrations of reserved URI schemes are ignored. – https://learn.microsoft.com/en-us/windows/uwp/launch-resume/launch-default-app?source=recommendations

Reserved URI scheme names – https://learn.microsoft.com/en-us/windows/uwp/launch-resume/reserved-uri-scheme-names#reserved-uri-scheme-names

image

And about,

test if passed https://myphotoapp.example.com/albums?albumname=vacation&index=1#secret, platform can access both query parameters after ? as well as value after #

were you able to test that with status-im:// then?

@jrainville
Copy link
Member

were you able to test that with status-im:// then?

I'll test it, but it should be supported

@felicio
Copy link

felicio commented May 10, 2023

were you able to test that with status-im:// then?

I'll test it, but it should be supported

Right.

And just to make sure, I was referring to

platform can access both query parameters after ? as well as value after #

@jrainville
Copy link
Member

@felicio I just tested and it works.
In the app I receive the full URL status-im://albums/?albumname=vacation&index=1#secret, so we can easily use a lib or regex to parse it as we want

@felicio
Copy link

felicio commented May 10, 2023

@felicio I just tested and it works.
In the app I receive the full URL status-im://albums/?albumname=vacation&index=1#secret, so we can easily use a lib or regex to parse it as we want

thank you @jrainville.

Going forward, do you favor status-app:// over status-im://?

@John-44 given the discussion here, Windows app won't automatically open on clicking https:// links. That aside, for redirects like "Open in...", do you prefer to keep status-im:// link or deprecate them in favor of status-app://?

Cc @jakubgs

@John-44
Copy link

John-44 commented May 10, 2023

@felicio I just tested and it works.
In the app I receive the full URL status-im://albums/?albumname=vacation&index=1#secret, so we can easily use a lib or regex to parse it as we want

thank you @jrainville.

Going forward, do you favor status-app:// over status-im://?

@John-44 given the discussion here, Windows app won't automatically open on clicking https:// links. That aside, for redirects like "Open in...", do you prefer to keep status-im:// link or deprecate them in favor of status-app://?

Cc @jakubgs

We should use status-app:// as it's more in-line with the status.app domain we will be using for the new websites going forward

@felicio
Copy link

felicio commented May 10, 2023

We should use status-app://

@jrainville @endulab please, will you handle that as part of this issue or create a follow-up?

@John-44
Copy link

John-44 commented May 10, 2023

@jrainville @felicio this Microsoft page describes how a Windows app can register to handle http and https links in it's manifest, so if the user clicks on a https link that contains a domain is associated with the app in the manifest, the link is opened by the app instead of a web browser https://learn.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-linking

Edit: just realised this is a page from Microsoft's UWP documentation :-(

@John-44
Copy link

John-44 commented May 10, 2023

Could packaging Status as a UWP app for windows could be an option? Probably not, but from a quick google: it seems that they can be directly installed without going through the windows app store ( https://stackoverflow.com/questions/71800494/digitally-sign-a-uwp-standalone-app-package ) and building UWP apps is supported by QT5 ( https://doc.qt.io/qt-5/winrt-support.html )

@jrainville
Copy link
Member

Reading the documentation, I have a couple of doubts/questions.

In the Microsoft docs, they say:

Starting with the Windows 10 Creators update, supported links clicked in Microsoft Edge Legacy will launch the corresponding app. Supported links clicked in other browsers (for example, Microsoft Edge Chromium, Internet Explorer, etc.), will keep you in the browsing experience.

Does that mean that only Edge Legacy supports that linking feature, or they are just explaining badly?

Then, they go on to show how to handle the link activation in the app... in C#.
I did find in another page there is also a C++ example, but it's still different from what we have right now, which is to pass the URL to the app as options eg: status.exe --url="status-im://c/0x...
We can maybe do the OnActivated in DOtherSide, but it needs investigation.

Another thing that concerned me from the QT docs is this:

The UWP clipboard is local to the application; it cannot be retrieved by a desktop application.

If it is really that we cannot share the clipboard from our app with other apps, then that's big hit on UX and not worth it IMO.


In sum, it seems like a big endeavor to switch from what we have right now to UWP, with such a small deadline.

Can we do that switch after the MVP and support status-app:// instead in the meantime?

The switch to status-app:// is gonna take 5 minutes BTW, compared to the whole adventure that is a switch to UWP 😆

@John-44
Copy link

John-44 commented May 10, 2023

Reading the documentation, I have a couple of doubts/questions.

In the Microsoft docs, they say:

Starting with the Windows 10 Creators update, supported links clicked in Microsoft Edge Legacy will launch the corresponding app. Supported links clicked in other browsers (for example, Microsoft Edge Chromium, Internet Explorer, etc.), will keep you in the browsing experience.

Does that mean that only Edge Legacy supports that linking feature, or they are just explaining badly?

Then, they go on to show how to handle the link activation in the app... in C#. I did find in another page there is also a C++ example, but it's still different from what we have right now, which is to pass the URL to the app as options eg: status.exe --url="status-im://c/0x... We can maybe do the OnActivated in DOtherSide, but it needs investigation.

Another thing that concerned me from the QT docs is this:

The UWP clipboard is local to the application; it cannot be retrieved by a desktop application.

If it is really that we cannot share the clipboard from our app with other apps, then that's big hit on UX and not worth it IMO.

In sum, it seems like a big endeavor to switch from what we have right now to UWP, with such a small deadline.

Can we do that switch after the MVP and support status-app:// instead in the meantime?

The switch to status-app:// is gonna take 5 minutes BTW, compared to the whole adventure that is a switch to UWP 😆

Agreed, I don't think changing to being a UWP app is a good idea for several reasons. Shared because I found that and thought it might be interesting in the conversation, but it's not something we should do.

@jrainville jrainville moved this from In Progress to Iteration Backlog in Status Desktop/Mobile Board May 12, 2023
@jrainville jrainville moved this from Iteration Backlog to Next Iteration in Status Desktop/Mobile Board May 16, 2023
@jrainville jrainville moved this from Next Iteration to In Progress in Status Desktop/Mobile Board May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants