From aa387baa8717dacb673e5f6cb1eb04012d3f5a73 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 23 Nov 2017 16:41:31 +0100 Subject: add tar.gz as a linux build target --- electron-builder.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'electron-builder.yml') diff --git a/electron-builder.yml b/electron-builder.yml index adc8f8ae9..994b5b0b8 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -27,6 +27,7 @@ linux: target: - target: AppImage - target: deb + - target: tar.gz nsis: perMachine: false -- cgit v1.2.3-70-g09d2 From adef56ef193a9b7a434b228010b0cc830f29bf06 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 24 Nov 2017 10:25:12 +0100 Subject: Set a synopsis and description for linux. Also fixed the icons on linux (tested on ubuntu --- build-helpers/images/icon.png | Bin 547480 -> 126364 bytes build-helpers/images/icons/1024x1024.png | Bin 547480 -> 126364 bytes electron-builder.yml | 2 ++ 3 files changed, 2 insertions(+) (limited to 'electron-builder.yml') diff --git a/build-helpers/images/icon.png b/build-helpers/images/icon.png index e0b4935b5..9c39f06e0 100644 Binary files a/build-helpers/images/icon.png and b/build-helpers/images/icon.png differ diff --git a/build-helpers/images/icons/1024x1024.png b/build-helpers/images/icons/1024x1024.png index e0b4935b5..9c39f06e0 100644 Binary files a/build-helpers/images/icons/1024x1024.png and b/build-helpers/images/icons/1024x1024.png differ diff --git a/electron-builder.yml b/electron-builder.yml index adc8f8ae9..2b2cf3fcb 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -24,6 +24,8 @@ linux: icon: ./build-helpers/images/icons category: Network;InstantMessaging; executableName: franz + synopsis: "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more." + description: "Franz is your messaging app / former Emperor of Austria and combines chat & messaging services into one application. Franz currently supports Slack, WhatsApp, WeChat, HipChat, Facebook Messenger, Telegram, Google Hangouts, GroupMe, Skype and many more. You can download Franz for free for Mac & Windows." target: - target: AppImage - target: deb -- cgit v1.2.3-70-g09d2 From 49cdd35696dcbe2a90c63dccc2d88db46e2aa8a9 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 5 Dec 2017 16:04:27 +0100 Subject: WIP: add deep linking --- electron-builder.yml | 4 ++++ package.json | 1 + src/electron/deepLinking.js | 5 +++++ src/index.js | 26 ++++++++++++++++++++++++-- src/stores/AppStore.js | 5 +++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/electron/deepLinking.js (limited to 'electron-builder.yml') diff --git a/electron-builder.yml b/electron-builder.yml index 03e59e462..96bd63cc2 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -34,3 +34,7 @@ linux: nsis: perMachine: false oneClick: true + +protocols: + name: Franz + schemes: [franz] diff --git a/package.json b/package.json index 8a5eee7b2..9c111d336 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.", "copyright": "adlk x franz - Stefan Malzner", "main": "index.js", + "homepage": "https://meetfranz.com", "repository": "https://github.com/meetfranz/franz.git", "private": true, "scripts": { diff --git a/src/electron/deepLinking.js b/src/electron/deepLinking.js new file mode 100644 index 000000000..819fdd095 --- /dev/null +++ b/src/electron/deepLinking.js @@ -0,0 +1,5 @@ +export default function handleDeepLink(window, url) { + console.log(url); + + window.webContents.send('navigateFromDeepLink', { url }); +} diff --git a/src/index.js b/src/index.js index 6a08e5e5a..4b6241f13 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,7 @@ import { isDevMode, isWindows } from './environment'; import ipcApi from './electron/ipc-api'; import Tray from './lib/Tray'; import Settings from './electron/Settings'; +import handleDeepLink from './electron/deepLinking'; import { appId } from './package.json'; // eslint-disable-line import/no-unresolved import './electron/exception'; @@ -26,10 +27,18 @@ if (isWindows) { } // Force single window -const isSecondInstance = app.makeSingleInstance(() => { +const isSecondInstance = app.makeSingleInstance((argv) => { if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); + + if (process.platform === 'win32') { + // Keep only command line / deep linked arguments + const url = argv.slice(1); + + console.log(url); + handleDeepLink(mainWindow, url); + } } }); @@ -70,7 +79,8 @@ const createWindow = () => { const trayIcon = new Tray(); // Initialize ipcApi - ipcApi({ mainWindow, settings, trayIcon }); + const franzIpcApi = ipcApi({ mainWindow, settings, trayIcon }); + console.log(franzIpcApi); // Manage Window State mainWindowState.manage(mainWindow); @@ -176,3 +186,15 @@ app.on('activate', () => { mainWindow.show(); } }); + +app.on('will-finish-launching', () => { + // Protocol handler for osx + app.on('open-url', (event, url) => { + event.preventDefault(); + console.log(`open-url event: ${url}`); + handleDeepLink(mainWindow, url); + }); +}); + +// Register App URL +app.setAsDefaultProtocolClient('franz'); diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 17ec832cf..557c9f7f2 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -116,6 +116,11 @@ export default class AppStore extends Store { } }); + // Handle deep linking (franz://) + ipcRenderer.on('navigateFromDeepLink', (event, data) => { + console.log(event, data); + }); + // Check system idle time every minute setInterval(() => { this.idleTime = idleTimer.getIdleTime(); -- cgit v1.2.3-70-g09d2