Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No vibrations on Android 10 devices #95

Open
4 tasks done
VaultDeveloper opened this issue Oct 21, 2020 · 5 comments
Open
4 tasks done

No vibrations on Android 10 devices #95

VaultDeveloper opened this issue Oct 21, 2020 · 5 comments

Comments

@VaultDeveloper
Copy link

VaultDeveloper commented Oct 21, 2020

Bug Report

Problem

What is expected to happen?

Vibrations.

What does actually happen?

No vibrations.

Command or Code

constructor(private vibration: Vibration)
{
	this.isvcVibration.vibrate(200);
}

Environment, Platform, Device

Only tested on Android devices. Everything is working fine until I use a Android 10 device. I have tested only on 2 Android 10 devices and both doesn't vibrate.
Little detail: If I click on the overwiew button (the right physic button on the bottom of the screen), the device vibrates when the app goes in background.

Version information

cordova-plugin-vibration: 3.1.1.
cordova-android: 9.0.0
cordova-plugin-androidx: 3.0.0
cordova-plugin-androidx-adapter: 1.1.1
I use the Ionic framework

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@faugusztin
Copy link

My Nokia 7.1 with Android 10 vibrates using this plugin. One thing to note is that 200ms is a really low value, it is the lowest value my phone vibrates at (100ms would not vibrate at all). You should try with longer vibration time (500ms-1000ms) to rule out the length of vibration being an issue, and then also you should try to call the Cordova plugin directly, like navigator.vibrate(500).

@VaultDeveloper
Copy link
Author

Thank you for your feedback. I performed additional tests based on the points you mentioned.

  • It doesn't work with 500ms or 1000ms.
  • It doesn't work with window.navigator.vibrate(1000).

Howewer, I try to do vibrations in another screens of my application and everything works fine (even 100 ms vibrations).
The only screen where it doesn't works is in the modal I need it. It works in another modal.
In this modal I use another plugin, which can also emit vibrations Scandit for Cordova. I wonder if there can't be conflicts between the two plugins.

Also, both Android 10 devices I've tested with are Honor. It is possible that the problem might occur only with the manufacturer.

@rchovan
Copy link

rchovan commented Mar 21, 2022

Hi, I can confirm this issue, but I have another two cents.
Vibration does not work on Android 10/11, tried 500ms too. On Android 7 vibration works.

@breautek
Copy link

v3 relies on the browser implementation for implementations. This plugin does not implement vibrations for the android platform itself.

I'd advise checking the JS console by using chrome's remote webview inspector, to see if there are any related error messages such as: Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet.

Potentially related to: #110

@van9petryk
Copy link

Just use v2
ionic cordova add [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants