Skip to content

Commit

Permalink
deep linking wip
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelneale committed Jan 8, 2025
1 parent 426e997 commit 68c3dbb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui/desktop/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 10 additions & 0 deletions ui/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -464,3 +472,5 @@ app.on('window-all-closed', () => {
app.quit();
}
});


0 comments on commit 68c3dbb

Please sign in to comment.