-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Support transaction push notifications #59308
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
Conversation
@neil-marcellini Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
Looks pretty good to me, but I don't understand how transaction push notifications will be tested, so I'm requesting changes. We should test that selecting a transaction notification navigates you to the expense report as described in the explanation of changes.
I understand backend changes are needed but we should still be able to manually test that on dev right? (edit: see comment below)
PushNotification.onReceived(PushNotification.TYPE.TRANSACTION, applyOnyxData); | ||
PushNotification.onSelected(PushNotification.TYPE.TRANSACTION, navigateToReport); |
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.
NAB: We don't have to refactor or fix this now but it's kind of weird that we do the same thing for all of these different types.
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.
Agreed. I'm working on removing the moneyRequest type since it's redundant. Handling transactions will also change a bit to handle some edge cases. I'm just handling the simple case for now though.
@@ -142,7 +145,7 @@ function navigateToReport({reportID, reportActionID}: ReportActionPushNotificati | |||
Navigation.goBack(); | |||
} | |||
|
|||
Log.info('[PushNotification] onSelected() - Navigation is ready. Navigating...', false, {reportID, reportActionID}); |
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.
NAB: You're sure the reportActionID isn't useful in the logs?
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.
Yeah since we're just navigating to the report, it's not really important here.
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.
Oh sorry I see, this has to go out before the backend changes. All good then.
This comment was marked as outdated.
This comment was marked as outdated.
Code looks good and tests well on Android, but I can't do the test on iOS for now Screen.Recording.2025-04-03.at.13.53.42.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-03.at.13.53.42.movAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@arosiclair @neil-marcellini I think we're good to merge now, for the iOS video, the evidence of @arosiclair is good. |
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.1.23-1 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.23-7 🚀
|
Explanation of Change
Adds support for
transaction
push notifications. These will be sent for various transaction related events like violations and e-receipts. Selecting the notification will navigate to the expense report.Fixed Issues
Part of #58307
Tests
Note: transaction notifications will be tested when the backend PR is deployed
Offline tests
None
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
screen-20250401-181719.mp4
iOS: Native
ScreenRecording_04-01-2025.18-05-32_1.mov