diff --git a/ui/desktop/forge.config.ts b/ui/desktop/forge.config.ts index 8dda27bc..73e2d074 100644 --- a/ui/desktop/forge.config.ts +++ b/ui/desktop/forge.config.ts @@ -17,6 +17,12 @@ let cfg = { appleIdPassword: process.env['APPLE_ID_PASSWORD'], teamId: process.env['APPLE_TEAM_ID'] }, + protocols: [ + { + name: "GooseProtocol", // The macOS CFBundleURLName + schemes: ["goose"] // The macOS CFBundleURLSchemes array + } + ] } if (process.env['APPLE_ID'] === undefined) { diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index 39acfc81..a36535c3 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -13,6 +13,14 @@ import { EnvToggles, loadSettings, saveSettings, updateEnvironmentVariables, cre // Handle creating/removing shortcuts on Windows when installing/uninstalling. if (started) app.quit(); +// deep linking +// This event is fired when the user opens "goose://..." +// Handle the protocol. In this case, we choose to show an Error Box. +app.on('open-url', (event, url) => { + dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`) +}) + + declare var MAIN_WINDOW_VITE_DEV_SERVER_URL: string; declare var MAIN_WINDOW_VITE_NAME: string; @@ -464,3 +472,5 @@ app.on('window-all-closed', () => { app.quit(); } }); + +