DeviceFeedback

Improve this doc

$ ionic plugin add cordova-plugin-velda-devicefeedback

Repo: https://github.com/VVelda/device-feedback

Plugin that lets you provide haptic or acoustic feedback on Android devices.

Supported platforms

Usage

import { DeviceFeedback } from 'ionic-native';

DeviceFeedback.acoustic();

DeviceFeedback.haptic(0);

DeviceFeedback.isFeedbackEnabled()
  .then((feedback) => {
    console.log(feedback);
    // {
    //   acoustic: true,
    //   haptic: true
    // }
  });

Static Members

acoustic()

Provide sound feedback to user, nevertheless respect user’s settings and current active device profile as native feedback do.

haptic(type)

Provide vibrate feedback to user, nevertheless respect user’s tactile feedback setting as native feedback do.

Param Type Details
type Number

Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.

isFeedbackEnabled()

Check if haptic and acoustic feedback is enabled by user settings.

Returns: Promise<any>

API

Native

General