Skip to content

Capacitor Plugin to detect when a physical device performs a shake gesture

Cap-go/capacitor-shake

@capgo/capacitor-shake

Capgo - Instant updates for capacitor

Detect shake gesture in device

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/shake/

Install

npm install @capgo/capacitor-shake
npx cap sync

API

Capacitor Shake Plugin interface for detecting shake gestures on mobile devices. This plugin allows you to listen for shake events and get plugin version information.

addListener('shake', ...)

addListener(eventName: 'shake', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for shake event on the device.

Registers a listener that will be called whenever a shake gesture is detected. The shake detection uses the device's accelerometer to identify shake patterns.

Param Type Description
eventName 'shake' The shake change event name. Must be 'shake'.
listenerFunc () => void Callback function invoked when the phone is shaken.

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


getPluginVersion()

getPluginVersion() => Promise<{ version: string; }>

Get the native Capacitor plugin version.

Returns the current version of the native plugin implementation.

Returns: Promise<{ version: string; }>

Since: 1.0.0


Interfaces

PluginListenerHandle

Prop Type
remove () => Promise<void>

About

Capacitor Plugin to detect when a physical device performs a shake gesture

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 5