diff --git a/src/expo-plugin/types/index.ts b/src/expo-plugin/types/index.ts index 116aed8..607711c 100644 --- a/src/expo-plugin/types/index.ts +++ b/src/expo-plugin/types/index.ts @@ -1,10 +1,12 @@ -export interface RNCloudStorageConfigPluginOptions { - /** - * The iCloud container environment to use. Defaults to 'Production'. - */ - iCloudContainerEnvironment?: 'Production' | 'Development'; - /** - * The iCloud container identifier to use. Defaults to `iCloud.{appBundleIdentifier}` - */ - iCloudContainerIdentifier?: string; -} +export type RNCloudStorageConfigPluginOptions = + | { + /** + * The iCloud container environment to use. Defaults to 'Production'. + */ + iCloudContainerEnvironment?: 'Production' | 'Development'; + /** + * The iCloud container identifier to use. Defaults to `iCloud.{appBundleIdentifier}` + */ + iCloudContainerIdentifier?: string; + } + | undefined; diff --git a/src/expo-plugin/withRNCloudStorageIos.ts b/src/expo-plugin/withRNCloudStorageIos.ts index 42670d7..521ef0a 100644 --- a/src/expo-plugin/withRNCloudStorageIos.ts +++ b/src/expo-plugin/withRNCloudStorageIos.ts @@ -3,7 +3,7 @@ import { type ExpoConfig } from '@expo/config-types'; import type { RNCloudStorageConfigPluginOptions } from './types'; const getICloudContainerIdentifier = (config: ExpoConfig, options: RNCloudStorageConfigPluginOptions) => { - if (options.iCloudContainerIdentifier) return options.iCloudContainerIdentifier; + if (options?.iCloudContainerIdentifier) return options.iCloudContainerIdentifier; if (!config?.ios?.bundleIdentifier) throw new Error('Missing iOS bundle identifier'); return `iCloud.${config.ios.bundleIdentifier}`;