Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exampleCsharp/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
1 change: 1 addition & 0 deletions exampleCsharp/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PLAID_PUBLIC_TOKEN
4 changes: 4 additions & 0 deletions exampleCsharp/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native',
};
66 changes: 66 additions & 0 deletions exampleCsharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage
7 changes: 7 additions & 0 deletions exampleCsharp/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions exampleCsharp/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 9 additions & 0 deletions exampleCsharp/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
105 changes: 105 additions & 0 deletions exampleCsharp/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.0.8.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.14.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
json (2.7.1)
minitest (5.22.3)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.3.6)
strscan
ruby-macho (2.5.1)
strscan (3.1.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.2, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (>= 1.13, < 1.15)

RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.2.27
116 changes: 116 additions & 0 deletions exampleCsharp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
Here is the modified `README.md` for the `exampleCsharp` app, tailored to include support for React Native Windows and clarify the setup instructions:

---
![simple example of csharp](./images/Example_Csharp.png)
### `README.md` for `exampleCsharp` App

# exampleCsharp App

The `exampleCsharp` app provides a minimal React Native app that implements Plaid Link, allowing you to link a sample bank account. This example includes support for Windows using C#.

### Prerequisites

Before running the example app, ensure you have:

- A [Plaid Account](https://dashboard.plaid.com/signup) to obtain your API keys.
- A [Link Token](https://plaid.com/docs/api/tokens/#linktokencreate). You can quickly fetch one using your API keys and the [Plaid Postman collection](https://github.com/plaid/plaid-postman).
- A properly set up React Native [development environment](https://reactnative.dev/docs/environment-setup), including support for Windows, iOS, and Android.

## Running the `exampleCsharp` App

1. **Navigate to the Example Directory:**

```sh
cd exampleCsharp
```

2. **Install Node Modules:**

```sh
npm install
```

3. **Install React Native Windows CLI:**

```sh
npm install -g react-native-windows
```

4. **Set Up the Windows Project:**

Navigate to the `windows` folder:

```sh
cd windows
```

If you haven't already set up the necessary dependencies, you might need to install additional tools like Visual Studio with UWP development tools.

5. **Install Bundler and Run the Pod Install (For iOS):**

```sh
bundle install
bundle exec pod install
```

6. **Start the React Native Server:**

Go back to the root directory of the `exampleCsharp` app and start the Metro bundler:

```sh
cd ..
npx react-native start
```

7. **Run the App on Your Target Platform:**

- **iOS:**
```sh
npx react-native run-ios
```

- **Android:**
```sh
npx react-native run-android
```

- **Windows:**
Make sure to open the solution file in Visual Studio and build the project for Windows. Then, run:
```sh
npx react-native run-windows
```
Build release:

```sh
npx react-native run-windows --release
```

### Running on Different Simulators

- [Running on iOS Simulator](https://reactnative.dev/docs/running-on-simulator-ios)
- [Running on Android Emulator](https://stackoverflow.com/a/63994477/7245977)

## Testing Plaid Link

1. **Fetch a [Link Token](https://plaid.com/docs/api/tokens/#linktokencreate).**
2. **Paste the Token** into the `TextField` in the `exampleCsharp` app.
3. **Press "OPEN LINK"** to initiate the Plaid Link process.
4. If you're testing in the Plaid Sandbox environment, use the provided [test credentials](https://plaid.com/docs/sandbox/test-credentials/) for any financial institution:

- **Username:** `user_good`
- **Password:** `pass_good`

### Screenshots

| Android | iOS | Windows |
| --------------------------------------------------- | ----------------------------------------------- | --------------------------------------------------- |
| <img src=./images/android_screenshot.png width=300> | <img src=./images/ios_screenshot.png width=300> | <img src=./images/Example_Csharp.png width=300> |

---

### Explanation of the Changes:

- **Added Windows Support:** Included steps to install `react-native-windows` and run the app on Windows.
- **Clarified Setup Instructions:** Added details on how to set up for iOS, Android, and Windows platforms.
- **Updated Screenshots Section:** Prepared a placeholder for a screenshot from the Windows platform to show the cross-platform support.

17 changes: 17 additions & 0 deletions exampleCsharp/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
Loading