|
1 | | -# react-native-sync-demo |
2 | | -Demo React Native App for react-native-sync |
| 1 | +## react-native-sync-demo |
| 2 | +Demo React Native App for [react-native-sync](https://github.com/pervasync/react-native-sync). |
| 3 | + |
| 4 | +### Setup the source code |
| 5 | +* DOwnload and unpack the demo app zip file |
| 6 | +* Work in app folder: ` cd react-native-sync-demo-master` |
| 7 | +* Run `yarn install` to populate node_modules |
| 8 | +* Run `react-native eject` to -create `ios` and `android` folders |
| 9 | +* Run `react-native link` to link native lib |
| 10 | + |
| 11 | +### Run the app |
| 12 | +Use Xcode to open the iOS project in the `react-native-sync-demo-master/ios` folder. Run the app in simulator. |
| 13 | + |
| 14 | +On the Settings tab, fill in the sync server and sync user info. Feel free to use our test server url: |
| 15 | +`http://203.195.233.31:8080/pervasync/server`. Use user name `user1` or `user2`. Password is `password`. |
| 16 | + |
| 17 | +After you save the server url and user credentials, navigate to the `Database` tab and do a pull-to-refresh to start a sync session. The initial sync may take 100 seconds to pull down around a set of tables with 10 thousand records and a handful of files from sync server. After that, incremental sync would only take a couple of seconds. Use the `Database` and `Files` tabs to examine the DB table contents and view the synod files. |
| 18 | + |
| 19 | +|:-------------:| :-------------:| |
| 20 | +||| |
| 21 | +||| |
| 22 | +||| |
| 23 | + |
| 24 | +### Your own sync server and React Native app |
| 25 | +If you like the sync tool, you can [setup your own sync server](https://docs.google.com/document/u/1/d/1Oioo0MxSArRgBdZ0wmLND-1AdzVLyolNd-yWw59tIC8/pub#h.mbk3tiu7nrjx) to [publish your database tables and OS folders](https://docs.google.com/document/u/1/d/1Oioo0MxSArRgBdZ0wmLND-1AdzVLyolNd-yWw59tIC8/pub#h.smru6um57rkf) to be synced to your mobile app. More info at [pervasync.com](http://www.pervasync.com/ ). |
| 26 | + |
| 27 | +You can create your own app based on the demo or write it from scratch. Either way, check out [react-native-sync](https://github.com/pervasync/react-native-sync) for details of the sync API. |
| 28 | + |
0 commit comments