mirror of
https://github.com/tradingview/charting-library-examples.git
synced 2024-11-25 16:27:09 +08:00
.. | ||
__tests__ | ||
.bundle | ||
android | ||
ios | ||
.eslintrc.js | ||
.gitattributes | ||
.gitignore | ||
.node-version | ||
.prettierrc.js | ||
.ruby-version | ||
.watchmanconfig | ||
app.json | ||
App.tsx | ||
babel.config.js | ||
Gemfile | ||
Gemfile.lock | ||
index.js | ||
metro.config.js | ||
package.json | ||
README.md | ||
tsconfig.json | ||
yarn.lock |
React Native Example
How to start - Android
- Setup the development environment. React Native Docs
- Ensure that you follow all the steps for installing dependencies such as node, watchman, Java development kit, and Android development environment
- You can return to this guide once you reach the 'Creating a new application' section.
- Run "npm install" in the project root folder. Wait until the installation completes.
- Open
android/app/src/main/assets
. - Copy all files from the charting_library repo. The earliest supported version of the Charting Library is 23. If you get 404 then you need to request an access to this repository. Note: Unlike some of the other examples you should copy all files from the repository not just the
datafeeds
andcharting_library
directories.- The folder structure should resemble this:
- android/app/src/main/assets/index.html
- android/app/src/main/assets/charting_library/
- android/app/src/main/assets/datafeeds/
- The folder structure should resemble this:
- Run "npx react-native run-android" to start installing the application to a device.
How to start - iOS
- Setup the development environment. React Native Docs
- Ensure that you follow all the steps for installing dependencies such as node, watchman, ruby (ensure that you install the correct version), xCode, and cocoaPods.
- You can return to this guide once you reach the 'Creating a new application' section.
- Run "npm install" in the project root folder. Wait until the installation completes.
- Open
/ios/ChartingLibraryExample.xcodeproj
in Xcode. - Right click on the
charting_library
folder and select "Add Files to ...". Select "Create folder references" for the added folders. This is important because the library contains files with the same name, but in different folders, so the "Create folder references" option adds files to your application bundle with the same folder structure as in the library.- Select all the files from the charting_library repo. This should include the
html
files, and thecharting_library
anddatafeeds
folders.
- Select all the files from the charting_library repo. This should include the
- Run
pod install
within theios
folder - Run "npx react-native run-ios" to start installing the application to a device.
Troubleshooting
If you have previously built an older version of this example in the same folder then you may need to clear out the old build files and artifacts. You can do this with the following command in your terminal (within the react-native
folder):
git clean -fdxq .
This will remove all the untracked files in the folder.