electron-deep-linking-mac-win icon indicating copy to clipboard operation
electron-deep-linking-mac-win copied to clipboard

What about deep linking on Linux?

Open mahnunchik opened this issue 4 years ago • 16 comments

What about deep linking on Linux?

mahnunchik avatar May 01 '20 10:05 mahnunchik

Doing the same as on win32 worked for me.

carloslfu avatar May 26 '20 22:05 carloslfu

It should be added to readme.

mahnunchik avatar May 26 '20 22:05 mahnunchik

Deeplink is not working on Linux/Ubuntu.

Installed and integrated plugin into our electron project. open on chrome with : Open app

getting below error linux_deeplink_issue

vijaygodhasara avatar Oct 20 '20 14:10 vijaygodhasara

.

what did you change for work on linux ?

vijaygodhasara avatar Oct 20 '20 14:10 vijaygodhasara

Replace process.platform == 'win32' with process.platform == 'win32' || process.platform == 'linux' and update to the latest electron version because it has a fix for linux in it.

sapkra avatar Oct 20 '20 16:10 sapkra

Checked with provided steps on ubuntu 18.04.

But still, I am getting the same issue.

here is the updated file

diff.txt

vijaygodhasara avatar Oct 21 '20 07:10 vijaygodhasara

vijay@vijay:~/electron-deep-linking-mac-win$ npm start

[email protected] start /home/vijay/electron-deep-linking-mac-win electron .

xdg-settings: default-url-scheme-handler not implemented for xfce createWindow# .

vijaygodhasara avatar Oct 21 '20 07:10 vijaygodhasara

also did with "npm run dist" and it will generate electron appimage file and installed that and checked with it. but same issue as well.

vijaygodhasara avatar Oct 21 '20 07:10 vijaygodhasara

We have implemented a check if appimaged or AppImageLauncher is installed. It seems to be that one of those is necessary for this to work.

sapkra avatar Oct 23 '20 22:10 sapkra

Could you please provide a code so I can check with it? what needs to change in code for work on Linux/ubuntu.

vijaygodhasara avatar Oct 26 '20 05:10 vijaygodhasara

This is the code we are currently using:

#!/bin/bash

IS_APP_IMAGE=false
APP_IMAGE_HELPER_IS_PRESENT=false
MESSAGE_TITLE="Missing dependencies"
MESSAGE="To provide you with a seamless experience, we rely on appimaged \
or AppImageLauncher. Please install one of these dependencies to continue"

###############################################################################
### Check for appimaged or appimagelauncher
###############################################################################

# Check if this script is launched in an appimage
if ! [ -z ${APPIMAGE+x} ]; then
    IS_APP_IMAGE=true
fi

# Check if a appimage helper is present
if command -v appimaged AppImageLauncher >/dev/null 2>&1; then
    APP_IMAGE_HELPER_IS_PRESENT=true
fi

if $IS_APP_IMAGE && ! $APP_IMAGE_HELPER_IS_PRESENT; then
    # try to send message with zenity
    if command -v zenity >/dev/null 2>&1; then
        zenity --info --height 50 --width 350 --text="$MESSAGE" --title="$MESSAGE_TITLE"
    # try to send message with kdialog
    elif command -v kdialog >/dev/null 2>&1; then
        kdialog --msgbox "$MESSAGE" --title "$MESSAGE_TITLE" 
    else
        echo "$MESSAGE"
    fi
    exit 1
fi

sapkra avatar Oct 26 '20 05:10 sapkra

Thanks for share a code. just run this shell script or I need to set from the code end.

vijaygodhasara avatar Oct 26 '20 06:10 vijaygodhasara

It's a bit more complex how we use it. First of all it's just part of an other script which disables sandboxing under some circumstances but I don't think it's relevant for your problem. What we are doing is to replace the original startup script within the afterPack hook.

sapkra avatar Oct 26 '20 06:10 sapkra

So this script basically checked appimage or AppImageLauncher is installed or not if installed that case checked command for zenity or kdialog. but My case already installed zenity. but this will not solve my problem.

vijaygodhasara avatar Oct 26 '20 07:10 vijaygodhasara

But have you installed appimage or AppImageLauncher on the machine where you are installing your app?

sapkra avatar Oct 27 '20 23:10 sapkra

I have installed appimage as a generated appimage then run as double clicks on the image. or another way using the command line. generated appimage chmod +x <APP_IMAGE> ./APP_IMAGE

vijaygodhasara avatar Oct 28 '20 10:10 vijaygodhasara