You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inmostcases, thecodewrittenforthisreposhouldbeplatform-independent. Insuchcases, eachmoduleshouldhaveasinglefile, `index.js`, whichdefinesthemodule's exports. There are, however, some cases in which a feature is intrinsically tied to the underlying platform. In such cases, the following file extensions can be used to export platform-specific code from a module:
**Note:** `index.js` should be the default and only platform-specific implementations should be done in their respective files. i.e: If you have mobile-specific implementation in `index.native.js`, then the desktop/web implementation can be contained in a shared `index.js`.
453
-
454
-
`index.ios.js` and `index.android.js` are used when the app is running natively on respective platforms. These files are not used when users access the app through mobile browsers, but `index.website.js` is used instead. `index.native.js` are for both iOS and Android native apps. `index.native.js` should not be included in the same module as `index.ios.js` or `index.android.js`.
WhenaddingnewAPIcommands (and preferably when starting using a newone that was not yet used inthis codebase) always
@@ -659,10 +651,7 @@ This application is built with the following principles.
659
651
5.UI updates with data from the server
660
652
661
653
1.**Cross Platform 99.9999%**
662
-
1.A feature isn't done until it works on all platforms. Accordingly, don't even bother writing a platform-specific code block because you're just going to need to undo it.
663
-
1. If the reason you can't write cross-platform code is because there is a bug in ReactNative that is preventing it from working, the correct action is to fix RN and submit a PR upstream -- not to hack around RN bugs with platform-specific code paths.
664
-
1. If there is a feature that simply doesn't exist on all platforms and thus doesn't exist inRN, rather than doing if (platform=iOS) { }, instead write a "shim" library that is implemented with NOOPs on the other platforms. For example, rather than injecting platform-specific multi-tab code (which can only work on browsers, because it's the only platform with multiple tabs), write a TabManager class that just is NOOP for non-browser platforms. This encapsulates the platform-specific code into a platform library, rather than sprinkling through the business logic.
665
-
1. Put all platform specific code in dedicated files and folders, like /platform, and reject any PR that attempts to put platform-specific code anywhere else. This maintains a strict separation between business logic and platform code.
654
+
See details [here](contributingGuides/philosophies/CROSS-PLATFORM.md).
Learn how the app supports features across all our different platforms.
3
+
4
+
Currently supported platforms:
5
+
- Web
6
+
- Mobile Web
7
+
- Desktop
8
+
- iOS
9
+
- Android
10
+
11
+
The goal is: **Cross Platform 99.9999%**
12
+
13
+
## Rules
14
+
### - Features MUST be implemented on all supported platforms
15
+
A feature isn't done until it works on all platforms. Any platform-specific code blocks will be asked to be undone.
16
+
17
+
### - React Native bugs MUST be fixed upstream
18
+
If the reason cross-platform code cannot be written is because there is a bug in ReactNative that is preventing it from working, the correct action is to fix RN and submit a PR upstream -- not to hack around RN bugs with platform-specific code paths.
19
+
20
+
While upstream PRs are waiting to be merged, a patch can be used which is managed by the NPM package `patch-package`. Read more about it [here](https://github.com/Expensify/App?tab=readme-ov-file#adding-hybridapp-related-patches).
21
+
22
+
### - Features that don't exist on all platforms MUST use NOOP shims
23
+
If there is a feature that simply doesn't exist on all platforms and thus doesn't exist in RN, rather than doing `if (platform=iOS) { }`, instead write a "shim" library that is implemented with NOOPs on the other platforms. For example, rather than injecting platform-specific multi-tab code (which can only work on browsers, because it's the only platform with multiple tabs), write a TabManager class that just is NOOP for non-browser platforms. This encapsulates the platform-specific code into a platform library, rather than sprinkling through the business logic.
24
+
25
+
### - Platform specific code MUST be placed in dedicated files and folders
26
+
Put all platform specific code in dedicated files and folders (see below) and reject any PR that attempts to put platform-specific code anywhere else. This maintains a strict separation between business logic and platform code.
27
+
28
+
## Platform-Specific File Extensions
29
+
In most cases, the code written for this repo should be platform-independent. In such cases, each module should have a single file, `index.js`, which defines the module's exports. There are, however, some cases in which a feature is intrinsically tied to the underlying platform. In such cases, the following file extensions can be used to export platform-specific code from a module:
**Note:**`index.js` should be the default and only platform-specific implementations should be done in their respective files. i.e: If you have mobile-specific implementation in `index.native.js`, then the desktop/web implementation can be contained in a shared `index.js`.
36
+
37
+
`index.ios.js` and `index.android.js` are used when the app is running natively on respective platforms. These files are not used when users access the app through mobile browsers, but `index.website.js` is used instead. `index.native.js` are for both iOS and Android native apps. `index.native.js` should not be included in the same module as `index.ios.js` or `index.android.js`.
38
+
39
+
### Supporting Mobile Web
40
+
The above platform-specific files only work because they are compiled when the app is built for the different platforms. This means that a different mechanism needs to be used for Mobile Web (since "mobile web" and "web" are the same at build time).
41
+
42
+
It is also well known that different mobile browsers have different quirks and need to use different workarounds at times.
43
+
44
+
#### - Mobile browser detection SHOULD never be used
45
+
If there is absolutely no other way to fix a bug, then the proper way of detecting the browser is using `@libs/Browser`. Use this as an absolute last resort and have the exception approved by several (ie. more than one) internal engineers.
Copy file name to clipboardExpand all lines: docs/articles/expensify-classic/bank-accounts-and-payments/bank-accounts/Connect-Personal-Bank-Account.md
+30-3Lines changed: 30 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,8 +52,35 @@ However, if you encounter an error during this process, you can close the pop-up
52
52
53
53
Some banks, such as Chase, may display masked or tokenized account numbers when connected via Plaid. This is a security feature implemented by the bank and does not indicate any setup error. As long as the connection was successful and you see your account listed in your **Wallet**, reimbursements should process correctly.
54
54
55
-
## Why can't I add my HSBC bank account details in Singapore?
56
-
57
-
You can. HSBC typically includes the **branch code** which is the final three digits of the Swift Code (HSBCSGS2XXX) in their "Account Number". If you see figures like "146172002492", please drop first 3 digit (146) which is the Branch Code.
55
+
## I can't find all the details for my bank in Singapore that you require. Where can I find them?
56
+
57
+
Expensify requires many fields to add a Singaporean Business account (for paying out) or Personal account (for receiving into). The Name and Address fields are self-explanatory. The other fields are:
58
+
59
+
- Swift Code
60
+
- Account Number
61
+
- Clearing Code
62
+
63
+
The Swift code can generally be found by searching for your bank [here](https://wise.com/gb/swift-codes/countries). It always contains a capitalized alphanumerical string of characters that end in either XXX or the bank **Branch Code**. There is no requirement to use anything but the XXX head office option.
64
+
65
+
The Account Number can usually be found on your statement or in your online banking portal. For example, HSBC typically includes the **Branch Code** (the final three digits of the Swift Code, e.g. HSBCSGS2XXX → 146) in the **Account Number**. If you see figures like `146172002492`, drop the first 3 digits (`146`), which form the Branch Code, and use the remainder as the Account No.
66
+
67
+
The Clearing Code is made up of both the **Bank Code** and the **Branch Code** to form a full 7-digit Clearing Code. Some bank-specific help is outlined below:
68
+
69
+
-**UOB (Standard Accounts)** — Bank Code: 7375. Branch Code: first 3 digits of Account No. Account No: unchanged.
0 commit comments