https://github.com/tradle/react-native-image-store
https://github.com/tradle/react-native-image-store
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tradle/react-native-image-store
- Owner: tradle
- Created: 2018-11-16T15:24:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T23:19:15.000Z (almost 7 years ago)
- Last Synced: 2025-03-06T15:18:42.701Z (over 1 year ago)
- Language: Java
- Size: 23.4 KB
- Stars: 1
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-image-store
The goal: stop sending images over the React Native bridge! Instead, store them in the native-side image store and use [rn-fetch-blob](https://github.com/mvayngrib/rn-fetch-blob) to upload directly from native
iOS/Android normalization for https://facebook.github.io/react-native/docs/imagestore.html
Use this on the JS/native side to store images in native cache
## Getting started
`$ npm install react-native-image-store --save`
### Mostly automatic installation
`$ react-native link react-native-image-store`
### Manual installation
#### iOS
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-image-store` and add `RNImageStore.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNImageStore.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<
#### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import io.tradle.reactimagestore.RNImageStorePackage;` to the imports at the top of the file
- Add `new RNImageStorePackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-image-store'
project(':react-native-image-store').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-store/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-image-store')
```
## Usage
iOS/Android normalization for https://facebook.github.io/react-native/docs/imagestore.html