-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Set up app for Expo SDK, add haptic feedback for long presses with Expo Haptics #3607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, leaving for others to review
Just realized that this requires a change to the babel.config for web to work! I'm playing around with it now, will take it off draft-mode once I've figured it out. |
…r-expoHapticFeedback
Got the webpack stuff working! Although, I've learned that we won't be able to use a lot of the Expo on web (and they'll actually throw exceptions if we try to). |
@jasperhuangg is this ready for review? I wasn't sure based on the previous comment, but I wouldn't expect to be able to implement haptics on mobile web. |
@marcaaron Yup! Sorry if that wasn't clear with my previous comment, this is all good to go 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great on Android and doesn't break anything on web. I don't have an iOS device with haptics atm so I can't test that part, but everything builds OK.
I'm requesting changes because I believe we are possibly including packages that we don't need and can minimize the bundle size by removing them. If I'm super off about that lmk, but it would be good to confirm that's not the case.
Implemented the suggestions @marcaaron suggested, it still builds fine on Web, and haptics still works great on Android 👍 |
@marcaaron Got rid of the unnecessary stuff, should be good for another look! |
@HorusGoul @timszot Would love to hear your thoughts on what we've done here! I'm definitely not the most knowledgable about this stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we considered supporting Mobile Web by leveraging the Vibration API? Only Android browsers support that API, but we could implement it as a progressive enhancement, and when Apple decides to ship the API in Safari, it will work.
Ohh interesting, I haven't heard about this yet. That would definitely be a great idea to get more coverage, interested on hearing other people's thoughts. |
I'm cool with whatever you want to do here @jasperhuangg. I personally like the idea of including as many progressive web app features that we can into the mobile web side, but less certain if this is a company wide priority. Feels maybe a bit out of scope to me and we can probably go back and add something like this later. |
Sounds good, I think I'll drop a question in #product or #expensify-open-source, and depending on what they say I'll create a new issue for it. In the meantime, I'm gonna go ahead and merge this 👍 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging in version: 1.0.77-6🚀
|
@marcaaron Can you please confirm this is expected to be tested on Mobile devices only for haptic(Vibration) feedback? Desktop and Web will not be easy to validate |
@mvtglobally That's correct. And also note that this will not work on mobile web either. This is expected. Only Android and iOS devices with haptic feedback features + running the native app will pass this QA. |
🚀 Deployed to production in version: 1.0.79-4🚀
|
NOTE TO REVIEWERS:
Details
I previously opened #3586, which added haptic feedback from a haptics library that wasn't as popular as we would have liked, so @marcaaron suggested I use Expo Haptics.
This PR sets up our app with
react-native-unimodules
, which is needed to use any Expo SDKs, includingexpo-haptics
. I used this guide provided by Expo to set upreact-native-unimodules
, which is the source of the diffs in any Objective-C, Java, gradle, and Pod files.It also adds haptic feedback using
expo-haptics
for any long-presses detected onPressableWithSecondaryInteraction
components.Fixed Issues
Fixes #3576
Tests (must be tested on an actual device and NOT a simulator)
QA Steps
Same as the above tests
Tested On
Screenshots
N/A