expo-file-system 16.0.1 → 16.0.3

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,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.0.3 — 2024-01-10
14
+
15
+ ### 🎉 New features
16
+
17
+ - Added support for macOS platform. ([#26253](https://github.com/expo/expo/pull/26253) by [@tsapeta](https://github.com/tsapeta))
18
+
19
+ ## 16.0.2 — 2023-12-19
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
13
23
  ## 16.0.1 — 2023-12-13
14
24
 
15
25
  _This version does not introduce any user-facing changes._
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '16.0.1'
6
+ version = '16.0.3'
7
7
 
8
8
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
9
  if (expoModulesCorePlugin.exists()) {
@@ -94,7 +94,7 @@ android {
94
94
  namespace "expo.modules.filesystem"
95
95
  defaultConfig {
96
96
  versionCode 30
97
- versionName "16.0.1"
97
+ versionName "16.0.3"
98
98
  }
99
99
  }
100
100
 
@@ -471,7 +471,9 @@ open class FileSystemModule : Module() {
471
471
 
472
472
  AsyncFunction("uploadAsync") { url: String, fileUriString: String, options: FileSystemUploadOptions, promise: Promise ->
473
473
  val request = createUploadRequest(
474
- url, fileUriString, options
474
+ url,
475
+ fileUriString,
476
+ options
475
477
  ) { requestBody -> requestBody }
476
478
 
477
479
  okHttpClient?.let {
@@ -519,7 +521,7 @@ open class FileSystemModule : Module() {
519
521
  val request = createUploadRequest(
520
522
  url,
521
523
  fileUriString,
522
- options,
524
+ options
523
525
  ) { requestBody -> CountingRequestBody(requestBody, progressListener) }
524
526
 
525
527
  val call = okHttpClient!!.newCall(request)
@@ -669,7 +671,11 @@ open class FileSystemModule : Module() {
669
671
  val call = client.newCall(request)
670
672
  taskHandlers[uuid] = DownloadTaskHandler(fileUri, call)
671
673
  val params = DownloadResumableTaskParams(
672
- options, call, fileUri.toFile(), resumeData != null, promise
674
+ options,
675
+ call,
676
+ fileUri.toFile(),
677
+ resumeData != null,
678
+ promise
673
679
  )
674
680
  moduleCoroutineScope.launch {
675
681
  downloadResumableTask(params)
@@ -1065,7 +1071,9 @@ open class FileSystemModule : Module() {
1065
1071
  val file = DocumentFile.fromSingleUri(context, uri)
1066
1072
  return if (file != null && file.isFile) {
1067
1073
  file
1068
- } else DocumentFile.fromTreeUri(context, uri)
1074
+ } else {
1075
+ DocumentFile.fromTreeUri(context, uri)
1076
+ }
1069
1077
  }
1070
1078
 
1071
1079
  // extension functions of Uri class
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-file-system",
3
- "platforms": ["ios", "android"],
3
+ "platforms": ["ios", "android", "macos", "tvos"],
4
4
  "ios": {
5
5
  "modules": ["FileSystemModule"],
6
6
  "appDelegateSubscribers": ["FileSystemBackgroundSessionHandler"]
@@ -5,7 +5,12 @@
5
5
  #import <ExpoFileSystem/EXFileSystem.h>
6
6
 
7
7
  #import <CommonCrypto/CommonDigest.h>
8
+
9
+ #if TARGET_OS_IOS || TARGET_OS_TV
8
10
  #import <MobileCoreServices/MobileCoreServices.h>
11
+ #elif TARGET_OS_OSX
12
+ #import <CoreServices/CoreServices.h>
13
+ #endif
9
14
 
10
15
  #import <ExpoFileSystem/EXFileSystemLocalFileHandler.h>
11
16
  #import <ExpoFileSystem/EXFileSystemAssetLibraryHandler.h>
@@ -25,7 +25,7 @@
25
25
  result[@"uri"] = fileUri;
26
26
  result[@"modificationTime"] = @(asset.modificationDate.timeIntervalSince1970);
27
27
  if (options[@"md5"] || options[@"size"]) {
28
- [[PHImageManager defaultManager] requestImageDataForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
28
+ [[PHImageManager defaultManager] requestImageDataAndOrientationForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, CGImagePropertyOrientation orientation, NSDictionary * _Nullable info) {
29
29
  result[@"size"] = @(imageData.length);
30
30
  if (options[@"md5"]) {
31
31
  result[@"md5"] = [imageData md5String];
@@ -84,7 +84,7 @@
84
84
  [EXFileSystemAssetLibraryHandler copyData:data toPath:toPath resolver:resolve rejecter:reject];
85
85
  }];
86
86
  } else {
87
- [[PHImageManager defaultManager] requestImageDataForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
87
+ [[PHImageManager defaultManager] requestImageDataAndOrientationForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, CGImagePropertyOrientation orientation, NSDictionary * _Nullable info) {
88
88
  [EXFileSystemAssetLibraryHandler copyData:imageData toPath:toPath resolver:resolve rejecter:reject];
89
89
  }];
90
90
  }
@@ -110,10 +110,12 @@
110
110
  hasWarned = YES;
111
111
  }
112
112
  return nil;
113
- #else
113
+ #elif TARGET_OS_IOS || TARGET_OS_TV
114
114
  // This is the older, deprecated way of fetching assets from assets-library
115
115
  // using the "assets-library://" protocol
116
116
  return [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
117
+ #elif TARGET_OS_OSX
118
+ return nil;
117
119
  #endif
118
120
  }
119
121
 
@@ -1,8 +1,8 @@
1
1
  // Copyright 2015-present 650 Industries. All rights reserved.
2
2
 
3
3
  #import <Foundation/Foundation.h>
4
+ #import <ExpoModulesCore/Platform.h>
4
5
  #import <ExpoModulesCore/EXSingletonModule.h>
5
- #import <UIKit/UIKit.h>
6
6
 
7
7
  NS_ASSUME_NONNULL_BEGIN
8
8
 
@@ -10,7 +10,11 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platforms = { :ios => '13.4', :tvos => '13.4'}
13
+ s.platforms = {
14
+ :ios => '13.4',
15
+ :osx => '10.15',
16
+ :tvos => '13.4'
17
+ }
14
18
  s.swift_version = '5.4'
15
19
  s.source = { :git => 'https://github.com/expo/expo.git' }
16
20
  s.static_framework = true
@@ -19,7 +19,9 @@ public final class FileSystemBackgroundSessionHandler: ExpoAppDelegateSubscriber
19
19
 
20
20
  // MARK: - ExpoAppDelegateSubscriber
21
21
 
22
+ #if os(iOS) || os(tvOS)
22
23
  public func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
23
24
  completionHandlers[identifier] = completionHandler
24
25
  }
26
+ #endif
25
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-file-system",
3
- "version": "16.0.1",
3
+ "version": "16.0.3",
4
4
  "description": "Provides access to the local file system on the device.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -41,5 +41,5 @@
41
41
  "peerDependencies": {
42
42
  "expo": "*"
43
43
  },
44
- "gitHead": "1c97be7c8c3c8661698038bf7912fb7c64ba8c35"
44
+ "gitHead": "ca014bf2516c7644ef303f4c21fdd68de4d99f76"
45
45
  }