Open flutter app windows by a custom schema

427

Solution 1

In case somebody is still looking for a solution, here it is: https://pub.dev/packages/uni_links_desktop Build and run the example project. You will understand how to configure the host for your app.

Solution 2

As I found out Deep link support in flutter windows app is complicated. you should make custom Registry entries to associate your URI scheme with your app. you need add this library to windows app. this instruction helps you with it. and for handling it in your flutter app you should write some c++ code to port data you need to flutter.
this package port this sdk to flutter for mobile and web: flutter-branch-sdk

handling deep link in Universal Windows Applications (UWP) is much easier but It is in flutter dev channel and is not stable and supported by the other 3rd party packages yet.
you can activate uwp by this instruction and create uwp in your existing project by run this command:

flutter create --platforms=winuwp

for adding deep link in "winuwp/runner_uwp/appxmanifest.in" make these changes:

<Packages 
 ...
 xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2"
 xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
 IgnorableNamespaces="uap uap2 uap3 mp">
<Application>
<Application Id="App" ...
<Extensions>
    <uap3:Extension Category="windows.appUriHandler">
      <uap3:AppUriHandler>
        <uap3:Host Name="flungoportfolio.com" />
      </uap3:AppUriHandler>
  </uap3:Extension>
  </Extensions>
</Application>
</Application>

How to add Deep links in UWP.

Share:
427
amir_a14
Author by

amir_a14

Updated on December 06, 2022

Comments

  • amir_a14
    amir_a14 over 1 year

    Some windows apps like telegram, can open with custom schema url by browser. When I install telegram on my windows pc and enter tg:// in browser, It can maximize telegram app or run telegram app if it not started yet.

    In flutter apps, we can use deep link for android and iOS, with the help of its document

    But how to open flutter windows app with deep link?