|
| 1 | + |
| 2 | +# react-native-web-view-local-cache |
| 3 | + |
| 4 | +## Getting started |
| 5 | + |
| 6 | +`$ npm install react-native-web-view-local-cache --save` |
| 7 | + |
| 8 | +### Mostly automatic installation |
| 9 | + |
| 10 | +`$ react-native link react-native-web-view-local-cache` |
| 11 | + |
| 12 | +### Manual installation |
| 13 | + |
| 14 | + |
| 15 | +#### iOS |
| 16 | + |
| 17 | +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` |
| 18 | +2. Go to `node_modules` ➜ `react-native-web-view-local-cache` and add `RNWebViewLocalCache.xcodeproj` |
| 19 | +3. In XCode, in the project navigator, select your project. Add `libRNWebViewLocalCache.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` |
| 20 | +4. Run your project (`Cmd+R`)< |
| 21 | + |
| 22 | +#### Android |
| 23 | + |
| 24 | +1. Open up `android/app/src/main/java/[...]/MainActivity.java` |
| 25 | + - Add `import com.reactlibrary.RNWebViewLocalCachePackage;` to the imports at the top of the file |
| 26 | + - Add `new RNWebViewLocalCachePackage()` to the list returned by the `getPackages()` method |
| 27 | +2. Append the following lines to `android/settings.gradle`: |
| 28 | + ``` |
| 29 | + include ':react-native-web-view-local-cache' |
| 30 | + project(':react-native-web-view-local-cache').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-web-view-local-cache/android') |
| 31 | + ``` |
| 32 | +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: |
| 33 | + ``` |
| 34 | + compile project(':react-native-web-view-local-cache') |
| 35 | + ``` |
| 36 | + |
| 37 | +#### Windows |
| 38 | +[Read it! :D](https://github.com/ReactWindows/react-native) |
| 39 | + |
| 40 | +1. In Visual Studio add the `RNWebViewLocalCache.sln` in `node_modules/react-native-web-view-local-cache/windows/RNWebViewLocalCache.sln` folder to their solution, reference from their app. |
| 41 | +2. Open up your `MainPage.cs` app |
| 42 | + - Add `using Cl.Json.RNWebViewLocalCache;` to the usings at the top of the file |
| 43 | + - Add `new RNWebViewLocalCachePackage()` to the `List<IReactPackage>` returned by the `Packages` method |
| 44 | + |
| 45 | + |
| 46 | +## Usage |
| 47 | +```javascript |
| 48 | +import RNWebViewLocalCache from 'react-native-web-view-local-cache'; |
| 49 | + |
| 50 | +// TODO: What do with the module? |
| 51 | +RNWebViewLocalCache; |
| 52 | +``` |
| 53 | + |
0 commit comments