Skip to content

Expo Config Plugin

The package includes a config plugin so Expo can generate the iCloud capability configuration during prebuild.

json
{
  "expo": {
    "plugins": [
      [
        "@oleg_svetlichnyi/expo-icloud-storage",
        {
          "containerIdentifier": "iCloud.$(CFBundleIdentifier)",
          "containerName": "$(PRODUCT_NAME)"
        }
      ]
    ]
  }
}

Options

OptionTypeDefaultDescription
containerIdentifierstringiCloud.$(CFBundleIdentifier)The iCloud container identifier written to NSUbiquitousContainers.
containerNamestring$(PRODUCT_NAME)The display name for the iCloud container.
isDocumentScopePublicbooleanfalseWhether the container documents are public in iCloud Drive.
supportedFolderLevelsstringAnyValue for NSUbiquitousContainerSupportedFolderLevels.
enableUsesIcloudStoragebooleantrueEnables ios.usesIcloudStorage when it is not already set.
configureUbiquitousContainersbooleantrueAdds the NSUbiquitousContainers entry.
configureEntitlementsbooleantrueAdds the iCloud container and CloudDocuments service to the generated entitlements plist.

Manual configuration

If you do not use the config plugin, add the iCloud config manually:

json
{
  "expo": {
    "ios": {
      "usesIcloudStorage": true,
      "infoPlist": {
        "NSUbiquitousContainers": {
          "iCloud.$(CFBundleIdentifier)": {
            "NSUbiquitousContainerIsDocumentScopePublic": false,
            "NSUbiquitousContainerName": "$(PRODUCT_NAME)",
            "NSUbiquitousContainerSupportedFolderLevels": "Any"
          }
        }
      }
    }
  }
}

If you use a custom iCloud container from the Apple Developer portal, replace iCloud.$(CFBundleIdentifier) with that identifier.

Apple Developer configuration

Your app identifier must have the iCloud capability enabled in the Apple Developer portal. In Xcode, the generated native target should show iCloud under Signing & Capabilities.

If isICloudAvailableAsync() returns false, verify:

  • the user is signed in to iCloud on the device
  • iCloud Drive is enabled on the device
  • the app target has iCloud capability
  • the iCloud container identifier matches your app configuration

Released under the MIT License.