0.0.9 • Published 2 years ago
cap-home-button v0.0.9
cap-home-button
A capacitor plugin with a listener for when the home button is pressed.
Install
npm install cap-home-button
npx cap sync
API
addListener('homePress', ...)
addListener(eventName: 'homePress', listenerFunc: (result: CapHomeButtonResult) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Listens to button presses.
Param | Type | Description |
---|---|---|
eventName | 'homePress' | only homePress is supported |
listenerFunc | (result: CapHomeButtonResult) => void | called on button press with a reason. Reason can be 'homekey', 'recentapps', 'dream', 'voiceinteraction', or similar. |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
Prop | Type |
---|---|
remove | () => Promise<void> |
CapHomeButtonResult
Prop | Type |
---|---|
reason | string |