expo-document-picker 10.1.3 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,18 +10,38 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 10.1.3 — 2022-02-09
13
+ ## 10.3.0 — 2022-07-07
14
14
 
15
15
  _This version does not introduce any user-facing changes._
16
16
 
17
- ## 10.1.2 — 2022-02-01
17
+ ## 10.2.1 — 2022-04-25
18
+
19
+ ### 💡 Others
20
+
21
+ - [plugin] Update to use codesigning variables in entitlements. ([#17158](https://github.com/expo/expo/pull/17158) by [@EvanBacon](https://github.com/EvanBacon))
22
+
23
+ ## 10.2.0 — 2022-04-18
24
+
25
+ ### 💡 Others
26
+
27
+ - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
28
+
29
+ ### ⚠️ Notices
30
+
31
+ - On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
32
+
33
+ ## 10.1.3 - 2022-02-09
34
+
35
+ _This version does not introduce any user-facing changes._
36
+
37
+ ## 10.1.2 - 2022-02-01
18
38
 
19
39
  ### 🐛 Bug fixes
20
40
 
21
41
  - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
22
42
  - Handle nil MIME type. ([#16156](https://github.com/expo/expo/pull/16156) by [@brentvatne](https://github.com/brentvatne))
23
43
 
24
- ## 10.1.1 2022-01-26
44
+ ## 10.1.1 - 2022-01-26
25
45
 
26
46
  ### 🐛 Bug fixes
27
47
 
package/README.md CHANGED
@@ -4,12 +4,12 @@ Provides access to the system's UI for selecting documents from the available pr
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/document-picker.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/document-picker.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/document-picker/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/document-picker/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/document-picker/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -31,7 +31,7 @@ No additional set up necessary.
31
31
 
32
32
  ### Plugin
33
33
 
34
- In order to enable Apple iCloud storage in managed EAS builds, you'll need to define the `appleTeamId` property in the config plugin:
34
+ You can change the `com.apple.developer.icloud-container-environment` entitlement using the `iCloudContainerEnvironment` property.
35
35
 
36
36
  `app.json`
37
37
 
@@ -41,18 +41,11 @@ In order to enable Apple iCloud storage in managed EAS builds, you'll need to de
41
41
  "usesIcloudStorage": true,
42
42
  "bundleIdentifier": "com.yourname.yourapp"
43
43
  },
44
- "plugins": [
45
- [
46
- "expo-document-picker",
47
- {
48
- "appleTeamId": "YOUR_TEAM_ID"
49
- }
50
- ]
51
- ]
44
+ "plugins": ["expo-document-picker"]
52
45
  }
53
46
  ```
54
47
 
55
- > Running `expo eject` will generate a the native project locally with the applied changes in your iOS Entitlements file.
48
+ > Running `expo prebuild` will generate the [native project locally](https://docs.expo.io/workflow/customizing/) with the applied changes in your iOS Entitlements file.
56
49
 
57
50
  # Contributing
58
51
 
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '10.1.3'
6
+ version = '10.3.0'
7
7
 
8
8
  buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
9
15
  // Simple helper that allows the root project to override versions declared by this library.
10
16
  ext.safeExtGet = { prop, fallback ->
11
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
18
  }
13
19
 
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.6.10")
26
+ }
27
+ }
28
+
14
29
  repositories {
15
30
  mavenCentral()
16
31
  }
17
32
 
18
33
  dependencies {
19
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
20
35
  }
21
36
  }
22
37
 
@@ -44,22 +59,22 @@ afterEvaluate {
44
59
  }
45
60
 
46
61
  android {
47
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
62
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
48
63
 
49
64
  compileOptions {
50
- sourceCompatibility JavaVersion.VERSION_1_8
51
- targetCompatibility JavaVersion.VERSION_1_8
65
+ sourceCompatibility JavaVersion.VERSION_11
66
+ targetCompatibility JavaVersion.VERSION_11
52
67
  }
53
68
 
54
69
  kotlinOptions {
55
- jvmTarget = JavaVersion.VERSION_1_8
70
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
56
71
  }
57
72
 
58
73
  defaultConfig {
59
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
60
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
75
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
61
76
  versionCode 17
62
- versionName '10.1.3'
77
+ versionName '10.3.0'
63
78
  }
64
79
  lintOptions {
65
80
  abortOnError false
@@ -72,5 +87,5 @@ dependencies {
72
87
  api "androidx.annotation:annotation:1.0.0"
73
88
  api 'commons-io:commons-io:2.6'
74
89
 
75
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
90
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
76
91
  }
@@ -1,2 +1,3 @@
1
1
  declare const _default: import("expo-modules-core").ProxyNativeModule;
2
2
  export default _default;
3
+ //# sourceMappingURL=ExpoDocumentPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoDocumentPicker.d.ts","sourceRoot":"","sources":["../src/ExpoDocumentPicker.ts"],"names":[],"mappings":";AAEA,wBAAqD"}
@@ -4,3 +4,4 @@ declare const _default: {
4
4
  getDocumentAsync({ type, multiple, }: DocumentPickerOptions): Promise<DocumentResult>;
5
5
  };
6
6
  export default _default;
7
+ //# sourceMappingURL=ExpoDocumentPicker.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoDocumentPicker.web.d.ts","sourceRoot":"","sources":["../src/ExpoDocumentPicker.web.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;0CAU3D,qBAAqB,GAAG,QAAQ,cAAc,CAAC;;AARpD,wBA4DE"}
package/build/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export { DocumentPickerOptions, DocumentResult };
12
12
  * If the user cancelled the document picking, the promise resolves to `{ type: 'cancel' }`.
13
13
  */
14
14
  export declare function getDocumentAsync({ type, copyToCacheDirectory, multiple, }?: DocumentPickerOptions): Promise<DocumentResult>;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,CAAC;AAGjD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,IAAY,EACZ,oBAA2B,EAC3B,QAAgB,GACjB,GAAE,qBAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAKtD"}
package/build/types.d.ts CHANGED
@@ -48,3 +48,4 @@ export declare type DocumentResult = {
48
48
  file?: File;
49
49
  output?: FileList | null;
50
50
  };
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,oBAAY,qBAAqB,GAAG;IAClC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAGF,oBAAY,cAAc,GACtB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B,CAAC"}
@@ -39,7 +39,7 @@
39
39
  static NSString * EXConvertMimeTypeToUTI(NSString *mimeType)
40
40
  {
41
41
  CFStringRef uti;
42
-
42
+
43
43
  // UTTypeCreatePreferredIdentifierForTag doesn't work with wildcard mimetypes
44
44
  // so support common top level types with wildcards here.
45
45
  if ([mimeType isEqualToString:@"*/*"]) {
@@ -56,7 +56,7 @@ static NSString * EXConvertMimeTypeToUTI(NSString *mimeType)
56
56
  CFStringRef mimeTypeRef = (__bridge CFStringRef)mimeType;
57
57
  uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeTypeRef, NULL);
58
58
  }
59
-
59
+
60
60
  return (__bridge_transfer NSString *)uti;
61
61
  }
62
62
 
@@ -80,7 +80,7 @@ EX_EXPORT_MODULE(ExpoDocumentPicker);
80
80
  - (void)setModuleRegistry:(EXModuleRegistry *)moduleRegistry
81
81
  {
82
82
  _moduleRegistry = moduleRegistry;
83
-
83
+
84
84
  if (_moduleRegistry != nil) {
85
85
  _fileSystem = [moduleRegistry getModuleImplementingProtocol:@protocol(EXFileSystemInterface)];
86
86
  _utilities = [moduleRegistry getModuleImplementingProtocol:@protocol(EXUtilitiesInterface)];
@@ -97,7 +97,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
97
97
  }
98
98
  _resolve = resolve;
99
99
  _reject = reject;
100
-
100
+
101
101
  NSArray *mimeTypes = options[@"type"] ?: @[@"*/*"];
102
102
  if (mimeTypes.count == 0) {
103
103
  reject(@"E_DOCUMENT_PICKER", @"type must be a list of strings.", nil);
@@ -136,7 +136,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
136
136
  #endif
137
137
  }
138
138
  @catch (NSException *exception) {
139
- reject(@"E_PICKER_ICLOUD", @"DocumentPicker requires the iCloud entitlement. If you are using ExpoKit, you need to add this capability to your App Id. See `https://docs.expo.io/versions/latest/expokit/advanced-expokit-topics#using-documentpicker` for more info.", nil);
139
+ reject(@"E_PICKER_ICLOUD", @"DocumentPicker requires the iCloud entitlement. If you are using ExpoKit, you need to add this capability to your App Id. See `https://docs.expo.dev/versions/latest/expokit/advanced-expokit-topics#using-documentpicker` for more info.", nil);
140
140
  self->_resolve = nil;
141
141
  self->_reject = nil;
142
142
  return;
@@ -165,7 +165,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
165
165
  _reject = nil;
166
166
  return;
167
167
  }
168
-
168
+
169
169
  NSURL *newUrl = url;
170
170
  if (_shouldCopyToCacheDirectory) {
171
171
  if (!_fileSystem) {
@@ -183,7 +183,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
183
183
  return;
184
184
  }
185
185
  }
186
-
186
+
187
187
  NSString *extension = [url pathExtension];
188
188
  NSString *mimeType = [EXDocumentPickerModule getMimeType:extension];
189
189
 
@@ -224,17 +224,17 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
224
224
  if (*error) {
225
225
  return 0;
226
226
  }
227
-
227
+
228
228
  if (fileAttributes.fileType != NSFileTypeDirectory) {
229
229
  return fileAttributes.fileSize;
230
230
  }
231
-
231
+
232
232
  // The path is pointing to the folder
233
233
  NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:error];
234
234
  if (*error) {
235
235
  return 0;
236
236
  }
237
-
237
+
238
238
  NSEnumerator *contentsEnumurator = [contents objectEnumerator];
239
239
  NSString *file;
240
240
  unsigned long long folderSize = 0;
@@ -244,7 +244,7 @@ EX_EXPORT_METHOD_AS(getDocumentAsync,
244
244
  return 0;
245
245
  }
246
246
  }
247
-
247
+
248
248
  return folderSize;
249
249
  }
250
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-document-picker",
3
- "version": "10.1.3",
3
+ "version": "10.3.0",
4
4
  "description": "Provides access to the system's UI for selecting documents from the available providers on the user's device.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "preset": "expo-module-scripts"
36
36
  },
37
37
  "dependencies": {
38
- "@expo/config-plugins": "^4.0.2",
38
+ "@expo/config-plugins": "~5.0.0",
39
39
  "uuid": "^3.3.2"
40
40
  },
41
41
  "devDependencies": {
@@ -44,5 +44,5 @@
44
44
  "peerDependencies": {
45
45
  "expo": "*"
46
46
  },
47
- "gitHead": "fc89e291a33d38323e192761f940ddc583513c76"
47
+ "gitHead": "e893ff2b01e108cf246cec02318c0df9d6bc603c"
48
48
  }
@@ -1,4 +1,2 @@
1
- import { ConfigPlugin } from '@expo/config-plugins';
2
- import { IosProps } from './withDocumentPickerIOS';
3
- declare const _default: ConfigPlugin<void | IosProps>;
1
+ declare const _default: import("@expo/config-plugins").ConfigPlugin<import("./withDocumentPickerIOS").IosProps>;
4
2
  export default _default;
@@ -3,8 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("@expo/config-plugins");
4
4
  const withDocumentPickerIOS_1 = require("./withDocumentPickerIOS");
5
5
  const pkg = require('expo-document-picker/package.json');
6
- const withDocumentPicker = (config, { appleTeamId = process.env.EXPO_APPLE_TEAM_ID, iCloudContainerEnvironment } = {}) => {
7
- config = (0, withDocumentPickerIOS_1.withDocumentPickerIOS)(config, { appleTeamId, iCloudContainerEnvironment });
8
- return config;
9
- };
10
- exports.default = (0, config_plugins_1.createRunOncePlugin)(withDocumentPicker, pkg.name, pkg.version);
6
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withDocumentPickerIOS_1.withDocumentPickerIOS, pkg.name, pkg.version);
@@ -1,7 +1,6 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
3
  export declare type IosProps = {
4
- appleTeamId?: string;
5
4
  /**
6
5
  * Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
7
6
  * the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
@@ -11,4 +10,4 @@ export declare type IosProps = {
11
10
  iCloudContainerEnvironment?: 'Development' | 'Production';
12
11
  };
13
12
  export declare const withDocumentPickerIOS: ConfigPlugin<IosProps>;
14
- export declare function setICloudEntitlements(config: Pick<ExpoConfig, 'ios'>, { appleTeamId, iCloudContainerEnvironment }: IosProps, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>): Record<string, any>;
13
+ export declare function setICloudEntitlements(config: Pick<ExpoConfig, 'ios'>, { iCloudContainerEnvironment }: IosProps, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>): Record<string, any>;
@@ -2,32 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setICloudEntitlements = exports.withDocumentPickerIOS = void 0;
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
- const withDocumentPickerIOS = (config, { appleTeamId, iCloudContainerEnvironment }) => {
5
+ const withDocumentPickerIOS = (config, { iCloudContainerEnvironment } = {}) => {
6
6
  return (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
7
- if (appleTeamId) {
8
- config.modResults = setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, config.modResults);
9
- }
10
- else {
11
- config_plugins_1.WarningAggregator.addWarningIOS('expo-document-picker', 'Cannot configure iOS entitlements because neither the appleTeamId property, nor the environment variable EXPO_APPLE_TEAM_ID were defined.');
12
- }
7
+ config.modResults = setICloudEntitlements(config, { iCloudContainerEnvironment }, config.modResults);
13
8
  return config;
14
9
  });
15
10
  };
16
11
  exports.withDocumentPickerIOS = withDocumentPickerIOS;
17
- function setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }) {
12
+ function setICloudEntitlements(config, { iCloudContainerEnvironment }, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }) {
18
13
  var _a;
19
14
  if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) {
20
15
  // Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
21
16
  // https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
22
17
  entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
23
18
  entitlements['com.apple.developer.icloud-container-identifiers'] = [
24
- 'iCloud.' + config.ios.bundleIdentifier,
19
+ `iCloud.${config.ios.bundleIdentifier}`,
25
20
  ];
26
21
  entitlements['com.apple.developer.ubiquity-container-identifiers'] = [
27
- 'iCloud.' + config.ios.bundleIdentifier,
22
+ `iCloud.${config.ios.bundleIdentifier}`,
28
23
  ];
29
- entitlements['com.apple.developer.ubiquity-kvstore-identifier'] =
30
- appleTeamId + '.' + config.ios.bundleIdentifier;
24
+ entitlements['com.apple.developer.ubiquity-kvstore-identifier'] = `$(TeamIdentifierPrefix)${config.ios.bundleIdentifier}`;
31
25
  entitlements['com.apple.developer.icloud-services'] = ['CloudDocuments'];
32
26
  }
33
27
  return entitlements;
@@ -1,15 +1,7 @@
1
- import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
1
+ import { createRunOncePlugin } from '@expo/config-plugins';
2
2
 
3
- import { withDocumentPickerIOS, IosProps } from './withDocumentPickerIOS';
3
+ import { withDocumentPickerIOS } from './withDocumentPickerIOS';
4
4
 
5
5
  const pkg = require('expo-document-picker/package.json');
6
6
 
7
- const withDocumentPicker: ConfigPlugin<IosProps | void> = (
8
- config,
9
- { appleTeamId = process.env.EXPO_APPLE_TEAM_ID, iCloudContainerEnvironment } = {}
10
- ) => {
11
- config = withDocumentPickerIOS(config, { appleTeamId, iCloudContainerEnvironment });
12
- return config;
13
- };
14
-
15
- export default createRunOncePlugin(withDocumentPicker, pkg.name, pkg.version);
7
+ export default createRunOncePlugin(withDocumentPickerIOS, pkg.name, pkg.version);
@@ -1,8 +1,7 @@
1
- import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';
1
+ import { ConfigPlugin, withEntitlementsPlist } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
3
 
4
4
  export type IosProps = {
5
- appleTeamId?: string;
6
5
  /**
7
6
  * Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
8
7
  * the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
@@ -14,28 +13,21 @@ export type IosProps = {
14
13
 
15
14
  export const withDocumentPickerIOS: ConfigPlugin<IosProps> = (
16
15
  config,
17
- { appleTeamId, iCloudContainerEnvironment }
16
+ { iCloudContainerEnvironment } = {}
18
17
  ) => {
19
18
  return withEntitlementsPlist(config, (config) => {
20
- if (appleTeamId) {
21
- config.modResults = setICloudEntitlements(
22
- config,
23
- { appleTeamId, iCloudContainerEnvironment },
24
- config.modResults
25
- );
26
- } else {
27
- WarningAggregator.addWarningIOS(
28
- 'expo-document-picker',
29
- 'Cannot configure iOS entitlements because neither the appleTeamId property, nor the environment variable EXPO_APPLE_TEAM_ID were defined.'
30
- );
31
- }
19
+ config.modResults = setICloudEntitlements(
20
+ config,
21
+ { iCloudContainerEnvironment },
22
+ config.modResults
23
+ );
32
24
  return config;
33
25
  });
34
26
  };
35
27
 
36
28
  export function setICloudEntitlements(
37
29
  config: Pick<ExpoConfig, 'ios'>,
38
- { appleTeamId, iCloudContainerEnvironment }: IosProps,
30
+ { iCloudContainerEnvironment }: IosProps,
39
31
  { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>
40
32
  ): Record<string, any> {
41
33
  if (config.ios?.usesIcloudStorage) {
@@ -44,13 +36,15 @@ export function setICloudEntitlements(
44
36
  entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
45
37
 
46
38
  entitlements['com.apple.developer.icloud-container-identifiers'] = [
47
- 'iCloud.' + config.ios.bundleIdentifier,
39
+ `iCloud.${config.ios.bundleIdentifier}`,
48
40
  ];
49
41
  entitlements['com.apple.developer.ubiquity-container-identifiers'] = [
50
- 'iCloud.' + config.ios.bundleIdentifier,
42
+ `iCloud.${config.ios.bundleIdentifier}`,
51
43
  ];
52
- entitlements['com.apple.developer.ubiquity-kvstore-identifier'] =
53
- appleTeamId + '.' + config.ios.bundleIdentifier;
44
+ entitlements[
45
+ 'com.apple.developer.ubiquity-kvstore-identifier'
46
+ ] = `$(TeamIdentifierPrefix)${config.ios.bundleIdentifier}`;
47
+
54
48
  entitlements['com.apple.developer.icloud-services'] = ['CloudDocuments'];
55
49
  }
56
50
  return entitlements;
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }