Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vibration.hasVibrator() promise false in iOS #50

Closed
hrshs opened this issue Nov 22, 2020 · 9 comments
Closed

Vibration.hasVibrator() promise false in iOS #50

hrshs opened this issue Nov 22, 2020 · 9 comments

Comments

@hrshs
Copy link

hrshs commented Nov 22, 2020

‍‍‍Vibration.hasVibrator() in iOS always promis false.
I've checked swift code and you get the value of hasVibrator from TARGET_OS_SIMULATOR == 1 and then this code always returns false in physical iOS device.
What's wrong?

@benjamindean
Copy link
Owner

Yeah, seems like it's a bug. I'll fix it as soon as I can.

@ZhuBoao
Copy link

ZhuBoao commented Nov 28, 2020

I am having the same issue. I had to downgrade the package for now. Appreciate very much if you can fix it.

@hrshs
Copy link
Author

hrshs commented Nov 28, 2020

@ZhuBoao I called Vibration.hasVibrator() only in android platform. I think it didn't cause any problem because the developer just check the device is physical or simulator.

@ZhuBoao
Copy link

ZhuBoao commented Nov 28, 2020

@ZhuBoao I called Vibration.hasVibrator() only in android platform. I think it didn't cause any problem because the developer just check the device is physical or simulator.

@hrshs I guess the iPad or maybe some iPods running iOS doesn't have any vibrator, so there should be a proper fix on iOS as well. Anyway, if the app only runs on iPhones, I agree we could safely assume that hasVibrator() return true.

@benjamindean
Copy link
Owner

@ZhuBoao Which version are you downgrading it to?

@benjamindean
Copy link
Owner

@ZhuBoao I created #52 for testing. If you have a physical device to test it on - I would really appreciate it. I don't have any, so that's why iOS code is kind of neglected.

@benjamindean
Copy link
Owner

I just published version 1.7.3. Hope it works!

@ZhuBoao
Copy link

ZhuBoao commented Nov 29, 2020

@benjamindean I just tested 1.7.3 on my iPhone X, and it works. Thanks!

@benjamindean
Copy link
Owner

Seems like the issue was resolved. Simulator env detection was migrated from Objective-C by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants