leanflutter / uni_links_desktop

A desktop (supports macOS and Windows) implementation of uni_links plugin.
https://pub.dev/packages/uni_links_desktop
MIT License
28 stars 15 forks source link

click open app in the browser when app already is running, run new instance of app. #6

Closed Ali-Fadaei closed 1 year ago

Ali-Fadaei commented 1 year ago

I think this issue will solved if just show (focus or move to foreground) the running app when click open app in the browser instead of run the app again.

at the end, I want to appreciate the authors for making this useful plugin 🙏🏻

lijy91 commented 1 year ago

Did you follow the usage to set it up? https://github.com/leanflutter/uni_links_desktop#windows

Ali-Fadaei commented 1 year ago

@lijy91 yes! set up is done.

Ali-Fadaei commented 1 year ago

Flutter (Channel stable, 3.3.8, on Microsoft Windows [Version 10.0.22621.819], locale en-US) • Flutter version 3.3.8 on channel stable at C:\Flutter\flutter • Upstream repository https://github.com/flutter/flutter • Framework revision 52b3dc25f6 (3 weeks ago), 2022-11-09 12:09:26 +0800 • Engine revision 857bd6b74c • Dart version 2.18.4 • DevTools version 2.15.0

Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.4) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.3.32901.215 • Windows 10 SDK version 10.0.22621.0

tested on windows 11 22h2

Ali-Fadaei commented 1 year ago

issue fixed by changing the + HWND hwnd = ::FindWindow(L"FLUTTER_RUNNER_WIN32_WINDOW", L"uni_links_desktop_example"); To + HWND hwnd = ::FindWindow(L"FLUTTER_RUNNER_WIN32_WINDOW", L"MY_APP_NAME");

I think this should mention in ReadMe.