appandflow / react-native-haptic Goto Github PK
View Code? Open in Web Editor NEWiOS 10 + haptic feedback for React Native applications
License: MIT License
iOS 10 + haptic feedback for React Native applications
License: MIT License
Hey,
So this is amazing!
I'm just coming back to RN after a long time and I find that Exponent is the easiest way to build apps now. I had built my own custom keyboard component back in August of last year but I never figured out how to package it for Exponent, which was very new at the time.
How would we use this in Exponent?
Thanks!!
Gettings Ordered comparison between pointer and zero ('NSNumber *' and 'int')
when I try to run the example. I think you just need to upgrade react-native
. Version 0.40.0
is very far behind.
Currently this module isn't supported all feedback types for impact
and notification
impact
- UIImpactFeedbackStylenotification
- UINotificationFeedbackTypeLet me know if PR welcome. :)
Is it possible for a built in fallback if < iOS 10?
Could you add a licence? ๐
If it's a permissive one, I was thinking about sending a PR to implement this in the RN core
Nvm, wrong repository! ๐
When I install this library from NPM, the podspec required for integration is missing.
For now I can use the repo as source, but it would be nice if the podspec would just be included in the NPM distribution.
Also, the Example/ios/build
is included in the distribution, which shouldn't, because it adds almost 150 megabytes. I think actually that the whole Example
directory should be excluded from the release.
Oh and also the typescript definitions are not included.
To download the archive from npm you can use the following url and see for yourself: https://registry.npmjs.org/react-native-haptic/-/react-native-haptic-1.0.5.tgz
Currently there are only 3 types defined in the ts definition.
I tested this lib on iPhoneX and it works like a charm.
But on iPhone 6s it doesn't work at all.
I've figured out, that on iPhone > 7 it works with different API then on iPhone 6, 6s.
On 6, 6s we should use something like this:
import AudioToolbox.AudioServices
// 'Peek' feedback (weak boom)
let peek = SystemSoundID(1519)
AudioServicesPlaySystemSound(peek)
When in iPhone > 7 we use this:
import UIKit
let notificationFeedbackGenerator = UINotificationFeedbackGenerator()
So, can you extend your library? A lot of people will be appreciated :)
Here is some info: https://medium.com/@sdrzn/make-your-ios-app-feel-better-a-comprehensive-guide-over-taptic-engine-and-haptic-feedback-724dec425f10
I'm using this package and really like it. However, on Android it causes a crash unless you limit it's use to iOS (e.g. if ( Platform.OS === 'ios' ) ...
). Why not handle the non-iOS case within this package, to make it easier on the user?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.