FIX: Sound effects in native app#73798
Conversation
|
|
…7-fixNativeSoundEffects
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
@situchan E/Mobile-Expensify PR https://github.com/Expensify/Mobile-Expensify/pull/13756 was merged 🟢 this one is ready for review now! Note: The ❌ eslint / typecheck / prettier are not directly related to this PR, they come from the |
…7-fixNativeSoundEffects
|
🟢 Ready for review! Merged main again to resolve the☝️ failing workflows coming from main. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb Chromemchrome.moviOS: HybridAppios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
OK, I'll trigger them now. |
|
🚧 @tgolen has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@tgolen Thanks for the adhoc bulilds! The successful adhoc build confirms that we don't need the patch anymore ✅ ♻️ I just tested the Android: Native adhoc build on a real device and sound effects work 🔊 (I'm assuming they work on iOS: Native as well, but cannot test since my device is not added for adhoc testing). Android: Native 🔊android.mp4How do we go about testing whether this works on HybridApp as well, are there adhoc builds for that ? ℹ️ QA asked me on the E/Mobile-Expensify PR why it's not working, I let them know and added [NoQA] there since this PR is needed in order for HybridApp to work as well. |
|
Hm, that's a good question. @mountiny or @AndrewGable do you know if there is a way to build an adhoc hybrid app? |
|
Oh, fancy! OK. I'll try that |
|
🚧 @tgolen has triggered a test Expensify/App build. You can view the workflow run here. |
|
Yep! Or as the PR template says: @ikevin127 you can just add the Mobile-Expensify PR there and the adhoc build would use that oldApp PR without the need for the engineer to specify it in the workflow dispatch trigger |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
Android: HybridApp sound effects work on the adhoc build ✅ Android: HybridApp 🔊android-hybrid.mp4The only thing I'm not able to test is on iOS: Native / HybridApp, maybe ask QA to verify before we merge just to be sure ? |
|
I get an integrity error when I try to install it on my iphone. I'm not sure why. I think it's probably safe enough to merge this as-is and just let QA do their testing on the real thing. Are you OK with that @ikevin127? |
Sounds like an AdHoc provisioning profile error. https://stackoverflowteams.com/c/expensify/questions/17615 |
@tgolen 🟢 Same, I agree and at this point I'm confident this will work on iOS: Native / HybridApp as well given that it works on Android. |
|
@AndrewGable that makes sense. This is a new phone, thank you! OK @ikevin127 I'll go ahead and merge it then. |
|
✋ 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 by https://github.com/tgolen in version: 9.2.46-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.46-3 🚀
|
|
@tgolen @ikevin127 Do you know what the expected behavior is for NewDot on mobile when the app is in the background? (silent mode turned off) Specifically, should the user hear a sound for incoming messages? If you’re not sure, who would be the best person to ask? |
|
@blazejkustra The 'while app is in the background' case wasn't part of this PRs scope so I'm not entirely sure what the desired behaviour is in terms of that, but here's a summary of my thoughts on this: TLDR: Not sure whether we have this logic in place already in the app - but there are options. In React Native apps, background audio behavior differs significantly from web browsers due to OS-level power management. Here is a summary of the expected behavior and control mechanisms: 📱 Expected Behavior
🛠️ Control Mechanisms To align the mobile experience with the web (e.g, Outlook / Mail in different tabs), one can control the following:
Conclusion: To ensure the user hears a sound, ensure the backend is sending a sound parameter in the push notification and that the corresponding sound file (or "default") is configured in the app's native resources (✅ this I know we have after the PR for this issue - sounds were added as native resources). |
I think this is the desired behavior, yes. Whether or not it's technically possible is something I would defer to others. |


Explanation of Change
The sound effects logic was first introduced in PR #31055, then latest major update was in PR #50130 about 1 year ago, at that time the sound effects worked as expected 🟢
🟡 The issue is caused by:
react-native-sound: v0.11.2we currently use is outdated / doesn't have support for new arch, which is causing the sounds to not play on new arch builds (what we have currently for both HybridApp and Native (Standalone)).Mobile-Expensify(iOS / Android: HybridApp) repo, the sound assets were not linked / added on native apps side which means the app that the users are currently using (HybridApp) simply does not have these sounds in their bundles once built, meaning there's no sound source / path to play.☝️ From this, the reason that the sounds are not playing are:
react-native-soundbeing outdated + the sound files missing from bundlesreact-native-soundbeing outdated (sounds are already linked)Important
Only works when built together with E/Mobile-Expensify PR https://github.com/Expensify/Mobile-Expensify/pull/13756.
Fixed Issues
$ #71881
PROPOSAL: #71881 (comment)
Tests
Precondition:
Mute all sounds from Expensifyis disabled / offOffline tests
N/A
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Standalone / HybridApp
android-standalone.mp4
android-hybrid.mp4
Android: mWeb Chrome
android-mweb.mp4
iOS: Standalone / HybridApp
ios-standalone.mov
ios-hybrid.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov