Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chirag04/react-native-icloud-sync
A react-native wrapper for syncing with icloud
https://github.com/chirag04/react-native-icloud-sync
Last synced: about 2 months ago
JSON representation
A react-native wrapper for syncing with icloud
- Host: GitHub
- URL: https://github.com/chirag04/react-native-icloud-sync
- Owner: chirag04
- Created: 2015-08-04T18:45:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-24T19:20:07.000Z (about 9 years ago)
- Last Synced: 2024-10-04T18:08:03.928Z (2 months ago)
- Language: Objective-C
- Size: 129 KB
- Stars: 58
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-react-native - react-native-icloud-sync ★41 - A react-native wrapper for syncing with icloud (Components / System)
- awesome-react-native - react-native-icloud-sync ★41 - A react-native wrapper for syncing with icloud (Components / System)
- awesome-react-native - react-native-icloud-sync ★41 - A react-native wrapper for syncing with icloud (Components / System)
- awesome-react-native - react-native-icloud-sync ★41 - A react-native wrapper for syncing with icloud (Components / System)
- awesome-react-native-ui - react-native-icloud-sync ★24 - A react-native wrapper for syncing with icloud (Components / System)
README
# react-native-icloud-sync
A react-native wrapper for syncing with icloud.
### Add it to your project
1. Run `npm install react-native-icloud-sync --save`
2. Open your project in XCode, right click on `Libraries` and click `Add
Files to "Your Project Name"` [(Screenshot)](http://url.brentvatne.ca/jQp8) then [(Screenshot)](http://url.brentvatne.ca/1gqUD).
3. Add `libRNiCloudSync.a` to `Build Phases -> Link Binary With Libraries`
[(Screenshot)](http://url.brentvatne.ca/17Xfe).
4. Whenever you want to use it within React code now you can: `var icloud = require('react-native-icloud-sync')`## Example
```javascript
var icloud = require('react-native-icloud-sync');//store.js
var store = {};//handle icloud progress.
icloud.eventEmitter.on('update', (update) => {
//reason for this update?
if([icloud.ServerChange, icloud.InitialSync].indexOf(update.reason) > -1) {
//update asyncStorage.
AsyncStorage.multiSet(STORAGE_KEYS);
}});
// subscribe for progress notifications.
icloud.subscribe();//save the progress to icloud
icloud.save(key, value);module.exports = store;
```