benjamindean / flutter_vibration

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

Does this only workon iOS 13 and higher? #37

Closed bagintz closed 4 years ago

bagintz commented 4 years ago

I am getting errors about SwiftVibrationPlugin on a device using iOS 12. Does this only work on 13 and up? Thanks!

benjamindean commented 4 years ago

What error are you getting exactly?

bagintz commented 4 years ago

I see this warning, which makes it sound like it won't work on devices < iOS 13.

Screen Shot 2020-06-25 at 9 40 00 AM

It does print out my test messages for Normal Vibrate and Amplitude Control (taken from your example), but no vibration happens. I do get a crash when trying Custom Control:

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

Screen Shot 2020-06-25 at 9 43 16 AM

I am not sure if I am getting the most informative error in XCode. If you point me somewhere else I can try to send more info.

bagintz commented 4 years ago

@benjamindean Ok, user error (I am an Android user) on the Normal Vibrate and Amplitude Control errors. When I got vibration working in general on the phone those both worked fine. I still get a crash when I get to:

await Vibration.hasCustomVibrationsSupport()

in the Flutter code on an iOS 12 device. I am going to wait until someone else comes in the office with an iOS 13 device, I will test that then and let you know, but I assume it works on iOS 13.

benjamindean commented 4 years ago

So, just to be clear:

  1. It does work on Android without any issues.
  2. Crashes on iOS 12 devices.
  3. It probably works on iOS 13.

Correct?

bagintz commented 4 years ago

Yes, I will test 3 and let you know for sure, but #1 and #2 is what I am seeing (Android 10)

bagintz commented 4 years ago

@benjamindean just tested, everything works fine on iOS 13

So it seems that the custom options don't work, and actually crash 12, but everything else is good to go!

bagintz commented 4 years ago

@benjamindean I got an iPhone 7 to test and for some reason now it will only trigger a single vibration even when using patterns, etc. Vibration.hasCustomVibrationsSupport() is returning false. Do you have any ideas of why that might be happening on 13.5.1? Thanks!

benjamindean commented 4 years ago

@bagintz I think it's only supported from iPhone 8. Check here (The first Note).

bagintz commented 4 years ago

@benjamindean that link just takes me to a long page of "technologies", I don't see a note. The other thing that I think is strange is that the iPhone 7 has the different vibration patterns like heartbeat, etc. So I would think it would work there ???

benjamindean commented 4 years ago

@benjamindean that link just takes me to a long page of "technologies", I don't see a note. The other thing that I think is strange is that the iPhone 7 has the different vibration patterns like heartbeat, etc. So I would think it would work there ???

Yes, it does, but seems like haptic engine is only supported on iPhone 8 and above. Not sure how accurate it is, but it's not surprising considering that it's Apple. Do you have anything newer than iPhone 7 to test it out?

bagintz commented 4 years ago

One of my other developers tested it out on his newer iphone, last couple generations. And it worked as expected. I will figure something out to make it work at this point for iOS < 13 and iPhone 7 :). Thanks @benjamindean for a great plugin!