mkuczera / react-native-haptic-feedback

React-Native Haptic Feedback for iOS with Android similar behaviour.
MIT License
868 stars 106 forks source link

iOS 13 Not Working #39

Closed ChristopherJohnson25 closed 5 years ago

ChristopherJohnson25 commented 5 years ago

This does not seem to be working on iOS 13, has anyone been experiencing the same issues?

mkuczera commented 5 years ago

Hi there, so far i didn´t notice any issues. Is there any Error and/or Warning inside XCode to provide more informations?

ChristopherJohnson25 commented 5 years ago

Yes, I just tested again, it does work! However, for some reason it's not getting fired on React Native Swiper actions. More than likely a problem with that, thanks!

ChristopherJohnson25 commented 5 years ago

On second thought, do you mind confirming the usage of this?

I'm not able to get this to work on any action (I come from Ember land, so not sure if correct).

See code here,

click(){
    ReactNativeHapticFeedback.trigger("selection");
}

<Button onPress={() => this.click()}>Selection Vibrate</Button>
mkuczera commented 5 years ago

Hi, sorry for the late response. this seems actually fine. Is there anything popping up as a warning? Note: the real haptic feedback on iOS is only available on iPhone 6s and up. Anything else needs to fall back to a vibrate. To enable this, just pass in the second argument as true

joseguya commented 5 years ago

@mkuczera Having issues with ios 13 too with a warning:

RNReactNativeHapticFeedback is not available

With not much else

ChristopherJohnson25 commented 5 years ago

It's odd, it seems to work in some functions, and not in others. I'm new to React Native, so it could be user error.

joseguya commented 5 years ago

I managed to log the error:

TypeError: Cannot read property 'trigger' of undefined at Function.RNReactNativeHapticFeedback.trigger (index.js:13)

At index.js of the package

For reference, my environment is:

.... "react": "16.8.3", "react-native": "0.59.10", "react-native-haptic-feedback": "^1.8.2" ....

My Podfile:

`platform :ios, '9.0'

target 'app' do rn_path = '../node_modules/react-native' pod 'React', path: rn_path, subspecs: [ 'Core', 'RCTActionSheet', 'RCTAnimation', 'RCTGeolocation', 'RCTImage', 'RCTLinkingIOS', 'RCTNetwork', 'RCTSettings', 'RCTText', 'RCTVibration', 'RCTWebSocket' ] pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

pod 'Firebase/Core', '~> 6.8.0' pod 'Firebase/Messaging', '~> 6.8.0' pod 'Firebase/DynamicLinks', '~> 6.8.0' pod 'Firebase/RemoteConfig', '~> 6.8.0' pod 'GoogleAppMeasurement', '6.1.1' pod 'Firebase/Auth', '~> 6.8.0' pod 'Firebase/Database', '~> 6.8.0' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler' pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker' pod 'RNLocalize', :path => '../node_modules/react-native-localize' pod 'RNSound', :path => '../node_modules/react-native-sound'

pod 'RNReactNativeHapticFeedback', :path => '../node_modules/react-native-haptic-feedback'

end

post_install do |installer| installer.pods_project.targets.each do |target| targets_to_ignore = %w(React yoga) if targets_to_ignore.include? target.name target.remove_from_project end end end`

pie6k commented 5 years ago

I've got the same issue,

I'm unsing React Native 0.61.2, I'm also using autolink feature with use_native_modules! inside Podfile

Calling trigger results in RNReactNativeHapticFeedback is not available

image.

mkuczera commented 5 years ago

Hi, i will have a look on this after the weekend. In the meantime: Is the Haptic Feedback Package in the pod install logs?

joseguya commented 5 years ago

Hi, i will have a look on this after the weekend. In the meantime: Is the Haptic Feedback Package in the pod install logs?

I finally made It work, and it was my mistake. The package was only set on one target and not in the one I was using at the moment. Working great now.

dnosk commented 4 years ago

Hi! I'm still getting this message

"react-native": "0.61.5", "react-native-haptic-feedback": "^1.8.2",

johnlim5847 commented 4 years ago

@dnosk Hi did you find any solution for this?

dnosk commented 4 years ago

I ended up writing it in Swift :/

mkuczera commented 4 years ago

Hi, i still can´t reproduce the issue. Do you guys have any repo project available? Also:

fritzfr commented 4 years ago

Had the same issue, but a clean build solved it.

Nicolaayip commented 3 years ago

Got same error, solved by manual linking with npm link react-native-haptic-feedback && cd ios && pod install

ebarahona commented 2 years ago

Check your imports, use the following: import ReactNativeHapticFeedback from 'react-native-haptic-feedback';