apache / cordova-plugin-vibration

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

CB-13045: Removed android implementation and Updated README #60

Closed maverickmishra closed 6 years ago

maverickmishra commented 6 years ago

The Android webview ( API level 19 and up ) natively supports the W3C spec and hence the android specific implementation can be dropped.

Checklist

janpio commented 6 years ago

Note: README still lists Android as supported platform for navigator.vibrate, navigator.notification.vibrate and navigator.notification.vibrateWithPattern.

Question: Does that mean that users of the plugin have to build an if-block to differentiate between iOS and Android to call the W3C spec code for Android?

maverickmishra commented 6 years ago

navigator.notification.vibrate and navigator.notification.vibrateWithPattern are already deprecated for the plugin. To answer your question, usage of navigator.vibrate will automatically use the W3C spec for Android and the iOS-specific code from the plugin for iOS.

janpio commented 6 years ago

navigator.notification.vibrate and navigator.notification.vibrateWithPattern are already deprecated for the plugin.

Ah ok, meaning that this change only drops support for cancelVibration where no standard support is available, thus only there the README is changed. Correct?

To answer your question, usage of navigator.vibrate will automatically use the W3C spec for Android and the iOS-specific code from the plugin for iOS.

Thanks for the clarification. Pays off if the plugins use the future standard APIs ;)

macdonst commented 6 years ago

@maverickmishra considering this is a breaking API change and we'll be bumping the version to 3.0.0 we might as well take out vibrateWithPattern & cancelVibration.

maverickmishra commented 6 years ago

Good idea! I'll make the necessary changes now