Deeplinking
The Capacitor Community Electron platform comes with a utility for enabling easy deeplinking for your applications.
#
How To Implement- Enable deepliking by adding the property
deepLinkingEnabled: true
to your capacitor.config file under theelectron
property.
...const config = { appId: 'com.company.appname', appName: 'My Capacitor App', webDir: 'www', electron: { deepLinkingEnabled: true, }};...
- If you dont want your app to use the default custom protocol of
mycapacitorapp
you will need to add another property to theelectron
prop. in the config file of:deepLinkingCustomProtocol: 'mycustomprotocol'
where you can set anything you wish as the custom protocol.
...const config = { appId: 'com.company.appname', appName: 'My Capacitor App', webDir: 'www', electron: { deepLinkingEnabled: true, deepLinkingCustomProtocol: 'mycustomprotocol', }};...
- From here you will need a plugin to handle the deep linking inside your webapp. The official
App
plugin from capacitor will handle this for example.