AppPlugin

canOpenUrl

canOpenUrl(options: { url: string }): Promise<{ value: boolean }>
Check if an app can be opened with the given URL
options { url: string }
Returns: Promise<{ value: boolean }>

exitApp

exitApp(): never
Force exit the app. This should only be used in conjunction with the `backButton` handler for Android to exit the app when navigation is complete.
Returns: never

getLaunchUrl

getLaunchUrl(): Promise<AppLaunchUrl>
Get the URL the app was launched with, if any
Returns: Promise<AppLaunchUrl>

openUrl

openUrl(options: { url: string }): Promise<{ completed: boolean }>
Open an app with the given URL
options { url: string }
Returns: Promise<{ completed: boolean }>

addListener

addListener(eventName: "appStateChange", listenerFunc: (state: AppState) => void): PluginListenerHandle
Listen for changes in the App's active state (whether the app is in the foreground or background)
eventName "appStateChange"
listenerFunc (state: AppState) => void
Returns: PluginListenerHandle

addListener

addListener(eventName: "appUrlOpen", listenerFunc: (data: AppUrlOpen) => void): PluginListenerHandle
Listen for url open events for the app. This handles both custom URL scheme links as well as URLs your app handles (Universal Links on iOS and App Links on Android)
eventName "appUrlOpen"
listenerFunc (data: AppUrlOpen) => void
Returns: PluginListenerHandle

addListener

addListener(eventName: "appRestoredResult", listenerFunc: (data: AppRestoredResult) => void): PluginListenerHandle
If the app was launched with previously persisted plugin call data, such as on Android when an activity returns to an app that was closed, this call will return any data the app was launched with, converted into the form of a result from a plugin call.
eventName "appRestoredResult"
listenerFunc (data: AppRestoredResult) => void
Returns: PluginListenerHandle

addListener

addListener(eventName: "backButton", listenerFunc: (data: AppUrlOpen) => void): PluginListenerHandle
Listen for the hardware back button event (Android only). Listening for this event will disable the default back button behaviour, so you might want to call `window.history.back()` manually. If you want to close the app, call `App.exitApp()`.
eventName "backButton"
listenerFunc (data: AppUrlOpen) => void
Returns: PluginListenerHandle

Interfaces Used

AppLaunchUrl

interface AppLaunchUrl {
url : string;
}