llfbandit / app_links

Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter.
https://pub.dev/packages/app_links
Apache License 2.0
176 stars 68 forks source link

Https Scheme Support For Windows #122

Open DmitryGaimaldinov opened 1 month ago

DmitryGaimaldinov commented 1 month ago

Is your feature request related to a problem? Please describe. I want to have https scheme support for Windows.

Describe the solution you'd like I'd like to have plugin support. And instructions to set up if native code changes will be needed like with universal links support on MacOS https://github.com/llfbandit/app_links/issues/121.

There is already the same closed issue https://github.com/llfbandit/app_links/issues/51 where fotiDim mentioned that https support can be done on windows https://learn.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-linking. I don't know if it can be done in flutter application.

llfbandit commented 1 month ago

As far as I know this is only available for UWP app. Flutter apps are win32 API apps. UWP support has been removed from Flutter as Microsoft seems to focus to other projects.

It may be possible through WinRT, I don't know...

DmitryGaimaldinov commented 1 month ago

@llfbandit thanks for the reply and information, I'll research this

clemeMnt commented 1 month ago

@DmitryGaimaldinov did u found anything ?

DmitryGaimaldinov commented 1 month ago

@clemeMnt sorry, no. My colleague said that it may really be done with WinRT but it will take to much time to implement. So we decided to make a simple website which will redirect to application through custom link

albe-jj commented 1 week ago

@DmitryGaimaldinov @clemeMnt Took me a while to figure out, but it can be done.

Https support can be easily implemented by creating an msix installer, building your app with https://pub.dev/packages/msix add the msix dependencies and adding in the pubspec.yaml

msix_config:
  ...
  protocol_activation: http, https, myapp
  app_uri_handler_hosts: myapp.com

this will open the app when clicking on the following links from a platform that is not the browser https://myapp.com http://myapp.com and myapp://something. if you click a link from the browser or enter the url in the search bar then only myapp://something will directly open your app. You can have https://myapp.com/something open your app also from the browser if in your webppage https://myapp.com you setup an automatic redirect from https://myapp.com/something to myapp://something. This is done for apps like Microsoft teams and Zoom.

Don't forget to sign your msix installer with code signing certificates otherwise nobody other than you will be able to install it.

@llfbandit perhaps would be nice to add a comment in the docs on how to handle https scheme.

llfbandit commented 1 week ago

I agree. Can you fill a PR for this?