Skip to main content
Version: 0.10

Install with CRNA

Step1 - Install

npm install react-native-cloud-store

For ReactNative 0.60+

Autolink was used, go to step 3 now

For ReactNative <0.60

npx react-native link react-native-cloud-store

Step3 - Setup

For Android

Not supported

For IOS

  1. Run npx pod-install in your project root

  2. Open your ios folder using XCode

  3. Because this module was written by swift, you need to create an empty swift file and a bridge header file in XCode: File -> New -> File -> Choose 'Swift File' -> Click Next -> save and create file -> XCode will prompt you to create an Objective-C bridging header, select "Create Briding Header"

    danger

    Don't delete the created empty swift file!

    If you are not prompt to create a bridging header file, you can manually create a xxx.h file and set header location as below (filename does not matter): briding-header

  4. Next step is add iCloud capability, inside your XCode, select your target -> Signing & Capabilities tab -> click "+ Capability" -> search and add "iCloud": add-ability-in-xcode

  5. Then scroll to iCloud part: if you use key-value storage check Key-value storage , if you use iCloud documents check iCloud Documents and then select or create a container and make sure the selected container was not in red which means not created, if color was red, just click arrow-7 to refresh: check-container-status

  6. (Optional Step) If you want to make your iCloud container's Documents folder visible to user, open Info.plist and change as the following:

        <key>NSUbiquitousContainers</key>
    <dict>
    <key>[THIS_IS_CONTAINER_ID_YOU_CHECKED_ABOVE]</key>
    <dict>
    <key>NSUbiquitousContainerIsDocumentScopePublic</key>
    <true/>
    <key>NSUbiquitousContainerName</key>
    <string>[THIS_IS_THE_NAME_SHOWED_IN_ICLOUD_DRIVE]</string>
    </dict>
    </dict>