Skip to content

Commit

Permalink
start integrating deeplinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Dec 19, 2024
1 parent 8671050 commit a1ac1ef
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 3 deletions.
112 changes: 109 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ cap-flags = { path = "../../../crates/flags" }
cap-recording = { path = "../../../crates/recording" }
cap-export = { path = "../../../crates/export" }
flume.workspace = true
tauri-plugin-deep-link = "2.2.0"

[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.24.0"
Expand Down
9 changes: 9 additions & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use std::{
time::Duration,
};
use tauri::{AppHandle, Emitter, Manager, Runtime, State, WindowEvent};
use tauri_plugin_deep_link::DeepLinkExt;
use tauri_plugin_dialog::DialogExt;
use tauri_plugin_notification::{NotificationExt, PermissionState};
use tauri_plugin_shell::ShellExt;
Expand Down Expand Up @@ -1908,6 +1909,7 @@ pub async fn run() {
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_deep_link::init())
.plugin(
tauri_plugin_window_state::Builder::new()
.with_state_flags({
Expand Down Expand Up @@ -1948,6 +1950,13 @@ pub async fn run() {
general_settings::init(&app);
fake_window::init(&app);

// this doesn't work in dev on mac, just a fact of deeplinks
app.deep_link().on_open_url(|event| {
// TODO: handle deep link for auth
dbg!(event.id());
dbg!(event.urls());
});

if let Ok(Some(auth)) = AuthStore::load(&app) {
sentry::configure_scope(|scope| {
scope.set_user(auth.user_id.map(|id| sentry::User {
Expand Down
5 changes: 5 additions & 0 deletions apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUyOTAzOTdFNzJFQkRFOTMKUldTVDN1dHlmam1RNHFXb1VYTXlrQk1iMFFkcjN0YitqZlA5WnZNY0ZtQ1dvM1dxK211M3VIYUQK"
},
"deep-link": {
"desktop": {
"schemes": ["cap-desktop"]
}
}
},
"bundle": {
Expand Down

1 comment on commit a1ac1ef

@vercel
Copy link

@vercel vercel bot commented on a1ac1ef Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.