ionic-cap-volume-button-listener
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

ionic-cap-volume-button-listener

Listen for Volume Button pressed in IONIC Capacitor Project

Install

npm install ionic-cap-volume-button-listener
npx cap sync

API

addListener('volumeButtonPressed', ...)

addListener(event: 'volumeButtonPressed', listenerFunc: VolumeButtonPressedListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for presses on the hardware volume buttons

Param Type
event 'volumeButtonPressed'
listenerFunc VolumeButtonPressedListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 1.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Removes all listeners for this plugin

Since: 1.0.0


Interfaces

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

VolumeButtonPressedListener

({ direction, }: VolumeButtonPressed): void

VolumeButtonPressed

{ direction: 'up' | 'down' }

For Android Only if(direction == 'up' ) Then Event will not be captures and continue original function like volume increase

if(direction == 'down' ) Then Event will be captures and no further action will be performed like no volume decrease

Credit: https://github.com/thiagobrez/capacitor-volume-buttons

/ionic-cap-volume-button-listener/

    Package Sidebar

    Install

    npm i ionic-cap-volume-button-listener

    Weekly Downloads

    0

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    27.1 kB

    Total Files

    26

    Last publish

    Collaborators

    • ziaa520