capacitor-plugin-linkhandler
v1.0.3
Published
This Plugin provides an Event Listener that executes when a user clicks on an link (href) in the App. The Event Listener helps to unify and handle Links Actions
Downloads
18
Readme
capacitor-plugin-linkhandler
This Plugin provides an Event Listener that executes when a user clicks on an link (href) in the App. The Event Listener helps to unify and handle Links Actions, for example to prevent that users leave your app. The event listener fires every time a user clicks on an anchor tag. The standard capacitor method that opens the link in the standard browser will be aborted. See the docs for more information:
- https://capacitorjs.com/docs/plugins/ios#override-navigation
- https://capacitorjs.com/docs/plugins/android#override-navigation
Install
npm install capacitor-plugin-linkhandler
npx cap sync
API
addListener('urlOpen', ...)
addListener(eventName: "urlOpen", listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle>
| Param | Type |
| ------------------ | --------------------------------------------------------------- |
| eventName
| 'urlOpen' |
| listenerFunc
| UrlChangeListener |
Returns: Promise<PluginListenerHandle>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
UrlEvent
| Prop | Type | Description | Since |
| --------- | ------------------- | ------------------------- | ----- |
| url
| string | Emit when the url changes | 0.0.1 |
Type Aliases
UrlChangeListener
(state: UrlEvent): void