A react-native wrapper for syncing with icloud
Objective-C JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
RNiCloudSync.xcodeproj initial commit Aug 4, 2015
RNiCloudSync initial commit Aug 4, 2015
RNiCloudSyncTests initial commit Aug 4, 2015
.flowconfig initial commit Aug 4, 2015
.gitignore initial commit Aug 4, 2015
README.md initial commit Aug 4, 2015
iCloudSync.ios.js initial commit Aug 4, 2015
package.json remove peerDep Sep 24, 2015

README.md

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) then (Screenshot).
  3. Add libRNiCloudSync.a to Build Phases -> Link Binary With Libraries (Screenshot).
  4. Whenever you want to use it within React code now you can: var icloud = require('react-native-icloud-sync')

Example

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;