All Projects → manicakes → React Native Icloudstore

manicakes / React Native Icloudstore

Licence: mit
A drop in replacement for React Native's AsyncStorage API that wraps the iCloud Ubiquitous Key-Value Store.

Projects that are alternatives of or similar to React Native Icloudstore

iCloudDownloader
CLI for downloading iCloud file
Stars: ✭ 82 (-42.66%)
Mutual labels:  icloud
Icloud Drive Docker
Dockerized iCloud drive
Stars: ✭ 33 (-76.92%)
Mutual labels:  icloud
Tothepenny
A budget tracker app for iOS
Stars: ✭ 82 (-42.66%)
Mutual labels:  icloud
Save-To-iCloud-Drive
Save documents to iCloud drive
Stars: ✭ 29 (-79.72%)
Mutual labels:  icloud
Fileprovider
FileManager replacement for Local, iCloud and Remote (WebDAV/FTP/Dropbox/OneDrive) files -- Swift
Stars: ✭ 724 (+406.29%)
Mutual labels:  icloud
Cirrus
☁️ Simple CloudKit sync for Codable Swift models
Stars: ✭ 65 (-54.55%)
Mutual labels:  icloud
iBadApple
First ever: Windows, free iCloud & activation lock bypass... that isn't a malware!
Stars: ✭ 133 (-6.99%)
Mutual labels:  icloud
Cloudkitgdpr
Framework for allowing users to manage data stored in iCloud
Stars: ✭ 126 (-11.89%)
Mutual labels:  icloud
Graph
Graph is a semantic database that is used to create data-driven applications.
Stars: ✭ 855 (+497.9%)
Mutual labels:  icloud
Swiftassetspickercontroller
A simple assets picker controller based on iOS 8 Photos framework. Supports iCloud photos and videos. It's written in Swift.
Stars: ✭ 81 (-43.36%)
Mutual labels:  icloud
Mfsidentifier
iOS App获取唯一标识符方案
Stars: ✭ 263 (+83.92%)
Mutual labels:  icloud
Zephyr
Effortlessly synchronize UserDefaults over iCloud.
Stars: ✭ 722 (+404.9%)
Mutual labels:  icloud
Ricloud
Python client for Reincubate's ricloud API. Yes, it works with iOS 14 & iPhone 12 backups!
Stars: ✭ 71 (-50.35%)
Mutual labels:  icloud
cloud-ignore-files
Make Cloud sync ignore certain project files
Stars: ✭ 70 (-51.05%)
Mutual labels:  icloud
Hardchoice
有时候作抉择真的很痛苦,Swift写的生活类APP
Stars: ✭ 90 (-37.06%)
Mutual labels:  icloud
pi-cloud-frame
An icloud-powered digital frame running on a Raspberry Pi. Downloads a random sample of photos from your icloud account, crops them to the correct aspect ratio and displays them. Supports parallel slideshows, interactive menus, GPS/EXIF lookup and auto rotation via a MPU-6050 accelerometer.
Stars: ✭ 21 (-85.31%)
Mutual labels:  icloud
Iclouddocumentsync
Integrate iCloud into iOS document projects with one-line code methods. Sync, upload, manage, and remove documents from iCloud quickly and easily. Helps to make iCloud "just work" for developers too.
Stars: ✭ 1,124 (+686.01%)
Mutual labels:  icloud
Cloudkit Demo.objective C
Stars: ✭ 133 (-6.99%)
Mutual labels:  icloud
Fcuuid
iOS UUID / Universally Unique Identifiers library as alternative to UDID and identifierForVendor. 📱
Stars: ✭ 1,387 (+869.93%)
Mutual labels:  icloud
Docker Icloudpd
An Alpine Linux 3.13 container for the iCloud Photos Downloader command line utility
Stars: ✭ 76 (-46.85%)
Mutual labels:  icloud

react-native-icloudstore 📱☁️📱

npm version

A drop in replacement for React Native's AsyncStorage API that wraps the iCloud Ubiquitous Key-Value Store.

Usage

In your target's "capabilities" tab in Xcode, make sure that iCloud is switched on as well as make sure that the "Key-value storage" option is checked.

react-native-icloudstore mimicks the same promise-based API as AsyncStorage. In addition to all of the AsyncStorage methods, there is one additional feature: a native event (iCloudStoreDidChangeRemotely) that lets you know when your store changed due to a remote change (i.e. from another device on the same iCloud account). See the example below for a very basic way to make use of that in your React Native application. For apps that use redux, you may want to call an appropriate action creator upon receiving the event.

import { NativeEventEmitter } from 'react-native';
import iCloudStorage from 'react-native-icloudstore';

...

  componentWillMount() {
    this.eventEmitter = new NativeEventEmitter(iCloudStorage);
    this.eventEmitter.addListener('iCloudStoreDidChangeRemotely', this.loadData);
  }

  componentWillUnmount() {
    this.eventEmitter.remove();
  }

  loadData = (userInfo) => {
    const changedKeys = userInfo.changedKeys;
    if (changedKeys != null && changedKeys.includes('MY_STORAGE_KEY')) {
      iCloudStorage.getItem('MY_STORAGE_KEY').then(result => this.setState({ storage: result }));
    }
  }
  
...
  

Install

npm install --save react-native-icloudstore

Automatically link

With React Native 0.27+

react-native link react-native-icloudstore

With older versions of React Native

You need rnpm (npm install -g rnpm)

rnpm link react-native-icloudstore

Manually link

iOS (via Cocoa Pods)

Add the following line to your build targets in your Podfile

pod 'RNICloudStore', :path => '../node_modules/react-native-icloudstore'

Then run pod install

iOS (without Cocoa Pods)

In XCode, in the project navigator:

  • Right click Libraries
  • Add Files to [your project's name]
  • Go to node_modules/react-native-icloudstore
  • Add the .xcodeproj file

In XCode, in the project navigator, select your project.

  • Add the libicloudstorage.a from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries
  • Click .xcodeproj file you added before in the project navigator and go the Build Settings tab. Make sure All is toggled on (instead of Basic).
  • Look for Header Search Paths and make sure it contains both $(SRCROOT)/../react-native/React and $(SRCROOT)/../../React
  • Mark both as recursive (should be OK by default).

Run your project (Cmd+R)

Android

Android isn't supported - importing will simply return AsyncStorage so your app should continue to work.

Feedback

Questions? Comments? Feel free to email me.

If you have an issue, please create an issue under the "Issues" tab above. Or, feel free to issue a pull request. 🤓

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].