Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
feat: support deeplink on Linux
Lucas.Xu7f7fd4958f78
diff --git a/frontend/appflowy_flutter/lib/startup/tasks/supabase_task.dart b/frontend/appflowy_flutter/lib/startup/tasks/supabase_task.dartindex b2b881d2e7..26d6014faf 100644--- a/frontend/appflowy_flutter/lib/startup/tasks/supabase_task.dart+++ b/frontend/appflowy_flutter/lib/startup/tasks/supabase_task.dart@@ -32,11 +32,6 @@ class InitSupabaseTask extends LaunchTask {return;}- // register deep link for Windows- if (Platform.isWindows) {- registerProtocolHandler(appflowyDeepLinkSchema);- }-supabase?.dispose();supabase = null;final initializedSupabase = await Supabase.initialize(@@ -47,6 +42,19 @@ class InitSupabaseTask extends LaunchTask {);realtimeService = SupbaseRealtimeService(supabase: initializedSupabase);supabase = initializedSupabase;++ if (Platform.isWindows) {+ // register deep link for Windows+ registerProtocolHandler(appflowyDeepLinkSchema);+ } else if (Platform.isLinux) {+ // register deep link for Linux+ await SupabaseAuth.instance.registerDBusService(+ // these values should be compatible with the values in the desktop file+ // dbus-interface.xml+ '/io/appflowy/AppFlowy/Object',+ 'io.appflowy.AppFlowy',+ );+ }}}diff --git a/frontend/appflowy_flutter/pubspec.lock b/frontend/appflowy_flutter/pubspec.lockindex 1857ce52df..9d05c3019e 100644--- a/frontend/appflowy_flutter/pubspec.lock+++ b/frontend/appflowy_flutter/pubspec.lock@@ -26,12 +26,13 @@ packages:source: hostedversion: "2.0.7"app_links:- dependency: transitive+ dependency: "direct overridden"description:- name: app_links- sha256: "16725e716afd0634a5441654b1dda2b6c5557aa230884b5e1f41a5aa546a4cb6"- url: "https://pub.dev"- source: hosted+ path: "."+ ref: f897e1d+ resolved-ref: f897e1d81a3d9fcea632588479bc2814d493f7b5+ url: "https://github.com/LucasXu0/app_links"+ source: gitversion: "3.4.3"appflowy_backend:dependency: "direct main"@@ -615,10 +616,10 @@ packages:dependency: transitivedescription:name: gotrue- sha256: "214d5050a68ce68a55da1a6d9d7a2e07e039b359f99f1a17ec685320c9101aa6"+ sha256: "6ba95e38c06af30d4a365112b433567df70f83d5853923274cb894ea9702c5fa"url: "https://pub.dev"source: hosted- version: "1.8.4"+ version: "1.11.2"graphs:dependency: transitivedescription:@@ -1036,10 +1037,10 @@ packages:dependency: transitivedescription:name: postgrest- sha256: "78fd180ecd2274df7b04c406746495b5c627248856458f8f537bf5348de9c817"+ sha256: d6cc0f60c7dc761f84d1c6d11d9e02b3ad90399bd84639a28c1c024adbaa9bdeurl: "https://pub.dev"source: hosted- version: "1.3.2"+ version: "1.5.0"process:dependency: transitivedescription:@@ -1084,10 +1085,10 @@ packages:dependency: transitivedescription:name: realtime_client- sha256: "0342f73f42345f3547e3cdcc804a0ed108fcd9142d1537d159aead94a213e248"+ sha256: ff743de9bb0f46fcfffcfe64ae93062702dcd0f83a2ce8adc40d5fb7f542af90url: "https://pub.dev"source: hosted- version: "1.1.1"+ version: "1.1.3"reorderables:dependency: "direct main"description:@@ -1409,18 +1410,19 @@ packages:dependency: transitivedescription:name: supabase- sha256: "5f5e47fcac99a496e15274d5f6944e1323519df9f8929b4ab9eef8711abeb5f3"+ sha256: "291e065aa8c9be06a0348743c184beafd038e109960bc3da201affd3eda811fc"url: "https://pub.dev"source: hosted- version: "1.9.4"+ version: "1.10.0"supabase_flutter:dependency: "direct main"description:- name: supabase_flutter- sha256: "1ebe89b83b992123d40dcf5aa88b87d6c2d0a3c62052380cfc94de2337aac469"- url: "https://pub.dev"- source: hosted- version: "1.10.4"+ path: "packages/supabase_flutter"+ ref: e882842+ resolved-ref: e8828421720896c0e1600de18f0db54f9f96a3b3+ url: "https://github.com/LucasXu0/supabase-flutter"+ source: git+ version: "1.10.12"sync_http:dependency: transitivedescription:@@ -1521,10 +1523,10 @@ packages:dependency: transitivedescription:name: universal_io- sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d"+ sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"url: "https://pub.dev"source: hosted- version: "2.2.0"+ version: "2.2.2"universal_platform:dependency: transitivedescription:diff --git a/frontend/appflowy_flutter/pubspec.yaml b/frontend/appflowy_flutter/pubspec.yamlindex d64f88b174..cf3c5c2e7e 100644--- a/frontend/appflowy_flutter/pubspec.yaml+++ b/frontend/appflowy_flutter/pubspec.yaml@@ -105,9 +105,6 @@ dependencies:envied: ^0.3.0+3dotted_border: ^2.0.0+3url_protocol:- git:- url: https://github.com/LucasXu0/flutter_url_protocol.git- commit: 77a8420hive: ^2.2.3hive_flutter: ^1.1.0@@ -130,6 +127,20 @@ dev_dependencies:dependency_overrides:http: ^1.0.0+ supabase_flutter:+ git:+ url: https://github.com/LucasXu0/supabase-flutter+ ref: e882842+ path: packages/supabase_flutter+ app_links:+ git:+ url: https://github.com/LucasXu0/app_links+ ref: f897e1d+ url_protocol:+ git:+ url: https://github.com/LucasXu0/flutter_url_protocol.git+ commit: 77a8420+# The "flutter_lints" package below contains a set of recommended lints to# encourage good coding practices. The lint set provided by the package is# activated in the `analysis_options.yaml` file located at the root of yourdiff --git a/frontend/scripts/flatpack-buildfiles/dbus-interface.xml b/frontend/scripts/flatpack-buildfiles/dbus-interface.xmlnew file mode 100644index 0000000000..a973b4bc4d--- /dev/null+++ b/frontend/scripts/flatpack-buildfiles/dbus-interface.xml@@ -0,0 +1,16 @@+<node name="/io/appflowy/AppFlowy/Object">+ <interface name="io.appflowy.AppFlowy">+ <method name="Activate">+ <arg type="a{sv}" name="platform_data" direction="in" />+ </method>+ <method name="Open">+ <arg type="as" name="uris" direction="in" />+ <arg type="a{sv}" name="platform_data" direction="in" />+ </method>+ <method name="ActivateAction">+ <arg type="s" name="action_name" direction="in" />+ <arg type="av" name="parameter" direction="in" />+ <arg type="a{sv}" name="platform_data" direction="in" />+ </method>+ </interface>+</node>diff --git a/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.desktop b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.desktopindex 8b51c0c2ea..f8f2c06842 100644--- a/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.desktop+++ b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.desktop@@ -5,3 +5,5 @@ Icon=io.appflowy.AppFlowyExec=env GDK_GL=gles AppFlowy %UCategories=Network;Productivity;Keywords=Notes+DBusActivatable=true+Implements=io.appflowy.Appflowy;\ No newline at end of filediff --git a/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.launcher.desktop b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.launcher.desktopnew file mode 100644index 0000000000..7b2366372d--- /dev/null+++ b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.launcher.desktop@@ -0,0 +1,5 @@+[Desktop Entry]+Type=Application+Name=AppFlowy Launcher+Exec=launcher.sh %u+MimeType=x-scheme-handler/appflowy-flutter;diff --git a/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.service b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.servicenew file mode 100644index 0000000000..31e32415d0--- /dev/null+++ b/frontend/scripts/flatpack-buildfiles/io.appflowy.AppFlowy.service@@ -0,0 +1,3 @@+[D-BUS Service]+Name=io.appflowy.AppFlowy+Exec=AppFlowydiff --git a/frontend/scripts/flatpack-buildfiles/launcher.sh b/frontend/scripts/flatpack-buildfiles/launcher.shnew file mode 100644index 0000000000..c7e7b9ee4a--- /dev/null+++ b/frontend/scripts/flatpack-buildfiles/launcher.sh@@ -0,0 +1,4 @@+#!/bin/bash+gdbus call --session --dest io.appflowy.AppFlowy \+ --object-path /io/appflowy/AppFlowy/Object \+ --method io.appflowy.AppFlowy.Open "['$1']" {}