-
Notifications
You must be signed in to change notification settings - Fork 282
Simplify the API? #26
Comments
This is indeed on my road-map. I plan to remove the shake custom event, and simply allow folks to pass their callbacks on instantiation. |
Great to hear! I could imagine a use case for having more Shake instances instead of a singleton (e.g. supporting light shakes vs. heavy shakes), but the shake event doesn't receive any parameters, so it couldn't distinguish how it was called anyway. |
This isn't really related to this issue. Not quite sure I understand your question, but you can execute any code you want when the event occurs. Please see the readme for how to use the plugin. |
What does that have to do with this plugin? |
As far as I understand that's a limitation of the full screen API, not this plugin. Shake is a custom event, so not necessarily the same as a native click. Regardless, this has nothing to do with this issue. Please open a new issue if you would like to discuss this further. |
I'm sorry @abkhan25 but the comments about full-screen and whatnot are off-topic here. @alexgibson: feel free to delete the clutter, including this comment of mine. |
I can here to propose a callback instead of custom event as you mentioned in second comment. I need to play a sound when user shakes, but it's not possible with a custom event. It requires a user interaction. Which I guess device motion is. So a callback should fix that. |
up up, this is important issue |
The current flow for detecting a shake looks more complicated than it needs to be:
@leecrossley's cordova-plugin-shake-detection has a minimally simple API:
Could the API be simplified?
The text was updated successfully, but these errors were encountered: