Skip to content

Conversation

@Skalakid
Copy link
Contributor

@Skalakid Skalakid commented Sep 11, 2025

Explanation of Change

This PR bumps the react-native-wallet library to the latest version (0.1.10). It includes support for RN 0.81 and new native "Add to Wallet" button components. In the new version localization prop has been removed, because as specified in the documentation, the language and style are automatically taken care of by the system (on both iOS and Android

Fixed Issues

$ #71078
PROPOSAL:

MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13690

Tests

  1. Test on physical device with signed build
  2. Open the app
  3. Go to Settings > Wallet
  4. Open any card page
  5. Verify if the style of the button and if it works (opens the native modal with card addition flow)
  6. Verify if you can add a card to wallet
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests

QA Steps

Same as Tests

  • [S] Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native android
Android: mWeb Chrome

N/A

iOS: Native ios
iOS: mWeb Safari

N/A

MacOS: Chrome / Safari

N/A

MacOS: Desktop

N/A

@Skalakid Skalakid requested a review from a team as a code owner September 11, 2025 12:04
@github-actions
Copy link
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@melvin-bot melvin-bot bot requested review from stitesExpensify and removed request for a team September 11, 2025 12:05
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2025

@stitesExpensify 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]

ios/Podfile.lock Outdated
Comment on lines 2850 to 2873
- RNFlashList (1.8.2):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.11.18.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-hermes
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all these bumps don't seem right, they don't belong to the PR. I wonder why they weren't included in some previous PRs related to the bumps 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also a bit concerned about them. Should I remove them and leave only wallet-related ones?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I'd prefer the removal, and maybe starting a discussion how we should approach the problem. It's not a big deal, but it should be addressed in some way. A simple action that runs pod install and compares the diff should suffice. I think it's been already raised by @sumo-slonik, but in general the approach that we have just seems messy

Co-authored-by: Mariusz Stanisz <mariusz.stanisz@swmansion.com>
@Skalakid Skalakid force-pushed the @Skalakid/bump-react-native-wallet-to-0.1.10 branch from 5641f3c to 5d0495c Compare September 16, 2025 08:30
@Skalakid Skalakid requested a review from a team as a code owner September 16, 2025 12:51
@zfurtak
Copy link
Contributor

zfurtak commented Sep 22, 2025

@stitesExpensify could you assign C+ to review this PR? :)

@mountiny mountiny requested a review from brunovjk September 22, 2025 16:28
@mountiny
Copy link
Contributor

Kicked off the build, @Skalakid I remember this was discussed somewhere but do you have an issue for it?

@github-actions
Copy link
Contributor

🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@Skalakid
Copy link
Contributor Author

Skalakid commented Sep 30, 2025

@shawnborton I think most of the things described on your screen attach to websites and email assets, not mobile apps. For mobile apps, the write:

For apps, use the PKAddPassButton class to create an Add to Apple Wallet button. You can choose the button’s style, and the system provides a control with the correct appearance and language. It’s available as a one-line button or two-line button.

This version of the button is slightly different, the border is thinner, and the background isn't totally black. Also wallet icon and text have a constant size. More info can be found in documentation. To match the design you show. I can try scaling the whole button in React Native, so the text and the icon are bigger, and there isn't that much passing inside

@shawnborton
Copy link
Contributor

I'm not really sure what to tell you. This is what I see directly from Apple:
CleanShot 2025-09-30 at 18 14 33@2x

Look at the mobile screen:
CleanShot 2025-09-30 at 18 14 49@2x

Why can't our badge look like that?

Even from the link you just gave me:
CleanShot 2025-09-30 at 18 15 07@2x

Let's make our badge look exactly like that.

@Skalakid
Copy link
Contributor Author

Skalakid commented Oct 1, 2025

@shawnborton I guess Apple changed PKAddPassButton designs, and now they have different padding and border radius. I've been trying to modify the button, but without much success. The buttons have a restricted design, and I can change only two things: whether it should have an outline and dark frame dimensions. Based on that, iOS creates a button automatically.

I tested both PKAddPassButton and AddPassToWalletButton components from Apple, and they return the same different design:
Screenshot 2025-10-01 at 11 52 23

The same button can be found in the Stripe library, and it has the same designs as the ones above:
Simulator Screenshot - iPhone 16 Pro - 2025-10-01 at 15 16 00

So I think this is a correct version for native apps. Not the one from the guidelines. They describe the website and email versions there.

Let's make our badge look exactly like that.

Taking into account all of that, it's impossible to style it "exactly like that" without hacking and changing the official Apple native component. I can change its scale 1.3x to match previous sizes and apply a custom border to match the previous design, and it will look as follows (upper button is mine changed and below we have the previous SVG one for comparison):

Simulator Screenshot - iPhone 16 Pro - 2025-10-01 at 15 06 45

Let me know if that works for you, but I personally would follow the consistent design from PassKit that is added in this PR and is created by an official Apple component.
If no, I can upload SVG assets to the E/App repo and create a new AddToAppleWallet button with them, so we will have the same designs as previously. However they won't support liquid glass designs and may not follow Apple guidelines for apps

cc @mountiny

@shawnborton
Copy link
Contributor

Yeah, that works for me. I don't want to hold this up anymore. It does feel odd that what we have in product is not looking like the many examples I am seeing from Apple but I'm not sure what else to say at this point.

@mountiny
Copy link
Contributor

mountiny commented Oct 1, 2025

Seems like that Apple just did not update all the screenshots with the new design.

@shawnborton @Skalakid so just to confirm, are there any changes to do here or is the design in the app/ size too that was shared above good to go?

@shawnborton
Copy link
Contributor

What I'm seeing here from the latest comment is good (top one I think):
CleanShot 2025-10-01 at 21 54 38@2x

@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/components/AddToWalletButton/index.native.tsx 0.00% 2 Missing ⚠️
...les/utils/addToWalletButtonStyles/index.android.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Skalakid
Copy link
Contributor Author

Skalakid commented Oct 3, 2025

@shawnborton @mountiny Hello, I've updated button styles on both Android and iOS. That's how it looks now:

Android iOS
Screenshot_1759491494 Simulator Screenshot - iPhone 16 Pro - 2025-10-03 at 15 02 24
Comparison with previous component
Android iOS
Screenshot_1759489849 Simulator Screenshot - iPhone 16 Pro - 2025-10-03 at 15 12 01

Let me know if that works for you :D

@shawnborton
Copy link
Contributor

cc @Expensify/design for extra eyes but I think this is probably good to ship 👍

@dannymcclain
Copy link
Contributor

I think so too 👍

@dubielzyk-expensify
Copy link
Contributor

LGTM2 👍

Copy link
Contributor

@stitesExpensify stitesExpensify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All you @mountiny

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mountiny mountiny merged commit ada8947 into Expensify:main Oct 7, 2025
27 of 28 checks passed
@OSBotify
Copy link
Contributor

OSBotify commented Oct 7, 2025

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Oct 8, 2025

🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.27-0 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

@mountiny
Copy link
Contributor

mountiny commented Oct 8, 2025

@Skalakid I have tested this in staging and it works fine in iOS, except after adding the card to the Wallet, the button did not change to the Added to Apple Wallet test. Was there some change?

@Skalakid
Copy link
Contributor Author

Skalakid commented Oct 8, 2025

hmmm @mountiny there wasn't any change that could affect that 🤔 I will check it

@Skalakid
Copy link
Contributor Author

Skalakid commented Oct 8, 2025

@mountiny I could reproduce it on prod v9.2.18.-7, and I think it's a problem with the backend response. In the video below, you can see that I'm trying to add the card with 4374 ending, but when completing the whole flow, the card with 9220 ending (the latest one I've created on this account) is added. Based on that, I think it's a problem with a backed/card issuer response during in-app provisioning

wrong.card.is.being.added.MP4

@mountiny
Copy link
Contributor

mountiny commented Oct 8, 2025

Hmm I do think in my case it added the correct card

@mountiny
Copy link
Contributor

mountiny commented Oct 8, 2025

The BE uses the cardID that is passed so if a wrong card was provisioned the App must have sent incorrect cardID then https://github.com/Expensify/Auth/blob/a5f87380694b700ba4d3ed7a8d469ddcc4c7b3af/auth/command/CreateDigitalWallet.cpp#L79

@mountiny
Copy link
Contributor

mountiny commented Oct 8, 2025

FYI, posted in the issue here to discuss #71078 (comment)

@OSBotify
Copy link
Contributor

OSBotify commented Oct 8, 2025

🚀 Deployed to production by https://github.com/lakchote in version: 9.2.27-6 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

InternalQA This pull request required internal QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants