apache / cordova-plugin-vibration

Apache Cordova Vibration Plugin
https://cordova.apache.org/
Apache License 2.0
127 stars 129 forks source link

Vibrate not working on Android 4.4.2 with Ionic 3 or 4 #79

Closed webspecialist closed 4 years ago

webspecialist commented 5 years ago

Bug Report

When I opened debug in Android studio shows me that...

Connecting to io.ionic.tester Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. V/Provider/Settings: get setting for user 0 by user 0 so skipping cache invalidate [system]: current 51 != cached 0 D/ActivityThread: hoder:android.app.IActivityManager$ContentProviderHolder@42c9b3c8,provider,holder.Provider:android.content.ContentProviderProxy@42c9bb40 V/Provider/Settings: from db cache, name = anr_debugging_mechanism , value = 1 D/asset: AssetManager-->addDefaultAssets CIP path not exsit! W/ActivityThread: Application io.ionic.tester is waiting for the debugger on port 8100... I/System.out: Sending WAIT chunk I/dalvikvm: Debugger is active A/libc: Fatal signal 11 (SIGSEGV) at 0x0000000a (code=1), thread 13232 (io.ionic.tester)

Problem

My phone is not vibrated.

What is expected to happen?

When I click to my button I am expecting to vibrate.

What does actually happen?

Nothing

Information

Local Notification with the options vibrate is working but not this plugin.

Command or Code

--type="ionic-angular" 
ionic cordova plugin add cordova-plugin-vibration
npm install --save @ionic-native/vibration@4
app.module.ts
import { Vibration } from '@ionic-native/vibration';

providers: [ ....
Vibration ....]

home.ts
import { Vibration } from '@ionic-native/vibration';
...
constructor(private vibration: Vibration){}

vibrate(){
    this.vibration.vibrate(2000);
  }

home.html
<button ion-button (click)="vibrate()" color="warning" full>Vibration</button>

in a similar (not same) way for --type="angular" 
ionic cordova plugin add cordova-plugin-local-notification
npm install @ionic-native/local-notifications
etc...

Environment, Platform, Device

My physical device Android 4.4.2 (kitkat)

Version information

Cordova: 8.1.2 (cordova-lib@8.1.1) Ionic: 4.10.3 Tested on --type="angular" and --type="ionic-angular"

Checklist

janpio commented 5 years ago

Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md

jcesarmobile commented 4 years ago

I can't reproduce on Ionic 4 app with latest ionic native and latest plugin version, so it's probably an user error, closing since they didn't provide the requested sample project.