onBackButtonPress
external fun onBackButtonPress(handler: (payload: OnBackButtonPressPayload) -> Unit): Promise<PluginListener>(source)
Listens to the Android hardware/gesture back button.
Registering a handler takes over the default behavior, so the app no longer navigates back or closes on its own: decide what to do inside the handler, using payload.canGoBack to know whether the webview has history to go back to.
Platform-specific
Android: Supported.
Windows / Linux / macOS / iOS: Unsupported, the handler is never called.
Since
2.9.0
Parameters
handler
Called on every back button press.