benjamindean / flutter_vibration

Handle vibration on iOS and Android in Flutter apps
219 stars 68 forks source link

It seem doesn't work #27

Closed disburden closed 4 years ago

disburden commented 4 years ago

Here is my code:

    void _submmit() async {
        if (await Vibration.hasVibrator()) {
            print("111");
            Vibration.vibrate(duration: 500);
            if (await Vibration.hasAmplitudeControl()) {
                Vibration.vibrate(amplitude: 128);
            }
        } else {
            print("222");
        }
    }

The log printed "111",but the phone didn't vibrate. My phone is :iPhone 7 IOS: 13.3.1

benjamindean commented 4 years ago

Does running Vibration.vibrate() without arguments has the same results?

ngothanhtai commented 4 years ago

I have the same problem. And I run without arguments @benjamindean.

benjamindean commented 4 years ago

@ngothanhtai What is the device?

ngothanhtai commented 4 years ago

@benjamindean the Vibrate.vibrate() does not work on my iPhone XR but it works when using Vibrate.feedback(FeedbackType.impact);

ngothanhtai commented 4 years ago

@benjamindean I am sorry, I am using other package flutter_vibrate that have Vibrate.feedback(FeedbackType.impact);.

itsakhiltiwari commented 4 years ago

Please consider that default vibration duration is only 500ms. It might actually be working but you aren't noticing it because it vibrates only for 500ms. Try increasing that duration.

disburden commented 4 years ago

It seems to be work, I don't know if it was the reason why I upgraded the iOS version, anyway, it's normal a few days ago. I'll close it first