ioscordovaionic-frameworkiphone-vibrate

Cordova does not vibrate as expected on iOS


In my Ionic 3.20 + cordova ios 4.5.4 app with cordova-plugin-vibration 3.0.1 and compiled against XCode 9.4.1, @ionic-native/vibration behaves this way on iPhone 7:

The same app compiled on Android works well and vibrates as expected.


Solution

  • This is a known issue with iOS. From the plugin's README:

    OS Quirks time: Ignores the specified time and vibrates for a pre-set amount of time.

    navigator.vibrate(3000); // 3000 is ignored