0.0.8 • Published 2 years ago
link-navigation-plugin v0.0.8
Link Navigation Plugin for Capacitor
This link navigation plugin for Capacitor creates a simple system alert window (overlay) that draws over other apps and allows user to navigate through the array of links passed into the plugin.
Only works on Android as system alert window functionality is not supported on iOS.
Additional features
- Show map button: Add query, longitude, latitude to the array elements.
Install
npm install link-navigation-plugin
npx cap sync
Usage
Add colorDark
and colorLight
resources at android/app/src/main/res/values/strings.xml
to customise the popup style.
<resources>
<color name="colorDark">#000000</color>
<color name="colorLight">#ffffff</color>
</resources>
Then trigger the popup from your code:
import { Overlay } from 'link-navigation-plugin';
Overlay.open({
values: [
{ name: "Google", url: "https://google.com" },
{ name: "Yahoo", url: "https://yahoo.com" },
]},
package: "com.example.app" // your package name for plugin to redirect back to
)
API
open(...)
open(options: { values: Link[]; package: string; }) => Promise<{ value: string; }>
Param | Type |
---|---|
options | { values: Link[]; package: string; } |
Returns: Promise<{ value: string; }>
close()
close() => Promise<{ lat?: number; lng?: number; }>
Returns: Promise<{ lat?: number; lng?: number; }>
state()
state() => Promise<{ isActive: boolean; }>
Returns: Promise<{ isActive: boolean; }>
Interfaces
Link
Prop | Type |
---|---|
url | string |
name | string |
query | string | null |
longitude | number | null |
latitude | number | null |
displacement | number | null |