tpucci / shake_gesture

0 dependencies Flutter plugin that detects shake gestures on Android and iOS (even on simulators).
MIT License
3 stars 4 forks source link

Rapid successive calls to onShake callback on Android #4

Closed dhikshithrm closed 4 months ago

dhikshithrm commented 7 months ago

After trying to replace our existing package with this package,

I've ran into these issues on Android,

  1. android build fails when trying to customise shake force threshold.
  2. sometimes the onShake callback is getting called rapidly 10, 100's of times in a second.
  3. emulator cmd + m simulation for shake gesture is not working after following Readme steps to do so.

Thats said this package is working perfectly fine on iOS since it's using existing apple sdk motionShake.

I have reverted back to the old package afterwards, i'll try to add the screenshots of the issues.

dhikshithrm commented 7 months ago
  • android build fails when trying to customise shake force threshold.

the build errors of the first issue say that the metadata is already defined in the package's android manifest already.

https://github.com/tpucci/shake_gesture/blob/582efe9c5da2862d51208d25b31b949df6e9fb3e/README.md?plain=1#L109-L120

tpucci commented 6 months ago

Sorry to see that you have those issue. The first one is fixed in 1.0.3. Indeed, the metadatas were already defined in the module.

Emulator simulation shake gesture only work on a detached emulator window. If you have your emulator inside a toolbox in Android Studio, it won't work. CMD+M acts as a press on a media button, a button that disappeared long ago.

The snippet in the readme redirects call to that button to the skake module. Just like React Native do.

For the repeated calls, do you have a reproducible demo ? I can't simulate that behavior on my side

tpucci commented 4 months ago

I will reopen this issue if I can reproduce it ✅