-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(Android): setup background task #54616
feat(Android): setup background task #54616
Conversation
756438d
to
33d2010
Compare
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
modules/background-task/expensify-react-native-background-task.podspec
Outdated
Show resolved
Hide resolved
99250b5
to
f3c9360
Compare
@szymonrybczak Can you fix the lint? |
🚧 @Beamanator has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
bdd2b44
to
2e8d5ba
Compare
@szymonrybczak can you please merge i'll try building again on my local, adhoc android build is still crashing for me |
2e8d5ba
to
c863526
Compare
@ishpaul777 done ✅ let me know what are the results when you run app locally 🙏 |
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.
Nice work so far. We just got the iOS PR merged, let's try to get this one merged soon too.
@szymonrybczak Local build is not crashing, but background task is not starting at all. Even if I force it. |
f441aa0
to
7472c60
Compare
Reviewer Checklist
Screenshots/VideosScreen.Recording.2025-01-17.at.2.39.44.PM.mov |
@szymonrybczak Can you fix your PR description? |
@ishpaul777 @shubham1206agra please keep in mind that it is c+ responsibility to make sure native changes and any podfile changes are also reflected in hybrid app when the contributor does not have access - we had to add the pod changes in this PR https://github.com/Expensify/Mobile-Expensify/pull/13365/files just for your interest. Please check if there is anything more to add from this PR too |
@mountiny, I did not reviewed the iOS PR for this feature. @mananjadhav reviewed that PR. |
@szymonrybczak Can you check if you need to do some config in HybridApp? |
@mountiny Can confirm it is working on HybridApp on latest main |
@shubham1206agra SWM has updated the Podfile for the ios part - just noting that if you need to make more changes here, dont forget about it. @szymonrybczak I believe you should have access to HybridApp now too |
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Failing action was just a GH comment. Not an emergency |
✋ 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/luacmartins in version: 9.0.88-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.88-7 🚀
|
Explanation of Change
Warning
This Pull Request is rebased on top of the Upgrade to React Native 0.76 Pull Request because it's using a new type-safe way of creating EventEmitters available only in 0.76, and relevant PR for iOS because it shares the same JS specs
Adds an implementation of background task on Android. This implemenation leverages JobScheduler API for scheduling tasks.
From the more technical perspective it's a C++ TurboModule that was bootstrapped as a Local Library so it's linked inside
package.json
.For now, we're scheduling new tasks in 15-minute intervals after the execution of the previous one.
How to test it?
You can view scheduled background task when running
adb shell dumpsys jobscheduler
:To force execution of the background task can execute following command on attached device:
specified id is a hash code of the
FLUSH-SEQUENTIAL-QUEUE-BACKGROUND-FETCH
string.Here's a video presenting this behaviour:
CleanShot.2024-12-27.at.12.38.54.mp4
Fixed Issues
$ #50140
PROPOSAL: #50140
Tests
Offline tests
QA Steps
Note: take into account that could some time for the first time, this times will be improved and vary depending on the app usage on the device. We set the interval between tasks to 15 minutes but at the end of the day Android decides when to execute it.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop