question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deep linking and appUrlOpen

See original GitHub issue

Describe the bug Hi @IT-MikeS, first of i want to thank you for all the work you are doing and for your reply in my other issue, I did not get the opportunity to thank you before the issue was closed 😄

The issue this time around has to do with Deep linking again and how it works in v3 (3.0.0-rc6) of the project. Currently I get zero deep-link url:s through to the Capacitor plugin App addUrlListener. In capacitor v2 and @capacitor-community/electron v1.4.x i could (when using electron <12) see the App.addListener('appUrlListener',data => {}) being triggered. This changed when upgrading Capacitor and @capacitor-community/electron to v3 versions.

So far I can think of two possible issues and I would be very grateful for any answer which could help me understand what is wrong

  1. Since electron 12 they changed the contextIsolation to be true by default which seems to cause some issue with plugins (#74), I still don’t know if this is causing the same kind of issues for the App plugging of Capacitor. If I try turn off contextIsolation in the options like this
mainWindow: {
    windowOptions: {
      webPreferences: { contextIsolation: false }
    }
  }

i still get nothing through to the appUrlListener. Will deep-links not work with @capacitor-community/electron v3.x? 2. Capacitor V3 App plugin and its appUrlListener are not compatible with @capacitor-community/electron v3.0.0-x deep-linking. Are there any solutions to this?

To Reproduce Steps to reproduce the behavior:

I’ve created a small repo which only contains a CRA and some react router stuff to run a small application which listens for deep links.

  1. Clone the repo git@github.com:vilasp/capacitor.git
  2. Run npm run build
  3. Run npx cap sync @capacitor-community/electron
  4. Run cd electron
  5. Run npm run electron:build-windows
  6. Install the MSI and open the application
  7. Open the devtools of the electron application
  8. Open the link electronboogie://signin-oidc in chrome
  9. Verify in devtools that no console message about the url from [8] is logged

Expected behavior When the link electronboogie://signin-oidc is entered from Chrome the application should gain focus and the appUrlListener which is registered should fire

Screenshots No need i think

Desktop (please complete the following information):

  • OS: Win 10 (20H2)
  • Browser, Chromium
  • Version: Chromium version of the Electron version used by the electron-builder dependency

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vilaspcommented, Jun 28, 2021

A couple of questions to follow up on this (also saw #91 which i think has the same issue),

  1. The idea is that the plugins that existed for v2 of Capacitor will exist for v3 as well, i.e. App, FileSystem etc…
  2. For the new Plugins will they use ContextBridge? I’m just thinking from a security point of view (nodeIntegration = false, contextIsolation = true, enableRemoteModules = false) how it’s intended to work on electron versions after 12.
  3. Any update on the timeline for the App and Filesystem plugins for v3?

Thanks again for your quick responses!

1reaction
vilaspcommented, Jun 28, 2021

Wonderful @IT-MikeS! Thank you very much for your work 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deep Links | Capacitor Documentation
Implement deep linking functionality in an iOS and Android app. ... Last, listen for the appUrlOpen event, and redirect when a deep link...
Read more >
How to Setup Deep Links With Capacitor (iOS & Android)
In this video we set up deep links (also known as universal links or app links ) within our Ionic app using Capacitor!...
Read more >
How to Setup Deep Links With Capacitor (iOS & Android)
In this post we will integrate these links, also known as deep links for both platforms so we are able to jump right...
Read more >
Handling Android App Links
... Pass data between destinations · Create a deep link for a destination ... App links. Overview · Enabling links to app content...
Read more >
Ionic deeplink/universal link with Capacitor.
The next thing is to listen to the appUrlOpen event, and redirect when a deep link is found or matched. initializeApp() { App.addListener(' ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found