Skip to main content
Version: 0.6

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:

  4. File -> New -> File -> Choose 'Swift File' and Click Next

  5. Save and create file, then 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 briding header file, you can manually create a .h file and set header location as below (filename not matter): briding-header

  6. Next step is add iCloud capability:

  • Go to developer account website and make sure your app identifier enabled iCloud: enable-icloud-in-identifier

  • Back to XCode, select your target -> Signing & Capabilities tab -> click "+ Capability" -> search and add "iCloud" just live below: add-ability-in-xcode

    then scroll to iCloud settings 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

  • (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>