[0.62.0-rc.1] Vibration.vibrate has unspecified nullability on iOS
See original GitHub issueDescription:
-
Vibration.vibrate() errors on iOS on 0.62.0-rc.1. Looks like something to do with TurboModules.
-
Error: Argument 0 (NSNumber) of Vibration.vibrate has unspecified nullability but React requires that all NSNumber arguments are explicitly marked as ‘nonnull’ to ensure compatibility with Android.
React Native version:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
Memory: 1014.98 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.6.0 - /usr/local/bin/node
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.62.0-rc.1 => 0.62.0-rc.1
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce
Vibration.vibrate(1);
Expected Results
Error-free vibration.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Customize iPhone for vibration sensitivities - Apple Support
If you have a sensitivity or intolerance to vibrations, you can customize iPhone to suit your needs. Set vibration options for specific alerts:...
Read more >How to make iPhone vibrate using Swift? - ios - Stack Overflow
import AudioToolbox AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);. But that is not working for me. ios · iphone · swift · vibration.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hramos I can reproduce on v0.62 rc1 and it doesn’t matter if I call it with a number as a param or without parameter, which makes sense because of it’s being called without params for iOS here
@trevyn is right about this being related to TurboModules. The problem is that numbers are not supported as nullable arguments in functions,
Just submitted a PR to fix the issue: https://github.com/facebook/react-native/pull/27951
Still seeing this in
react-native@0.62.0
in iOS.To reproduce on a fresh build:
Results in:
Expected:
Would expect this simple
Vibration.vibrate()
call to work, per the first example from the docs.Looks like the suggested PR (https://github.com/facebook/react-native/pull/27951) has status
Waiting on Facebook
?Is there anything we can do to help? 🙂