diff --git a/README.md b/README.md index 47a86e1..a35b2ce 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Zip archive utility for react-native In order to comply with the new privacy policy of the App Store on iOS, you need to upgrade react-native-zip-archive to version 7.0.0, which requires the deployment target to be iOS 15.5 or later. +## For Expo Users + +The only way to make this work with Expo is to create a [dev build](https://docs.expo.dev/workflow/overview/#development-builds), the expo go is not supported. + ## Compatibility | react-native version | react-native-zip-archive version | diff --git a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java index 36a157d..9da38dc 100644 --- a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java +++ b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java @@ -421,7 +421,7 @@ public void getUncompressedSize(String zipFilePath, String charset, final Promis long totalSize = getUncompressedSize(zipFilePath, charset); promise.resolve((double) totalSize); } - + /** * Return the uncompressed size of the ZipFile (only works for files on disk, not in assets) * diff --git a/index.js b/index.js index 578aeac..bfc9966 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,11 @@ const normalizeFilePath = (path) => path.startsWith("file://") ? path.slice(7) : path; export const unzip = (source, target, charset = "UTF-8") => { - return RNZipArchive.unzip(normalizeFilePath(source), normalizeFilePath(target), charset); + return RNZipArchive.unzip( + normalizeFilePath(source), + normalizeFilePath(target), + charset + ); }; export const isPasswordProtected = (source) => { return RNZipArchive.isPasswordProtected(normalizeFilePath(source)).then( @@ -49,8 +53,14 @@ export const zipWithPassword = ( export const zip = (source, target) => { return Array.isArray(source) - ? RNZipArchive.zipFiles(source.map(normalizeFilePath), normalizeFilePath(target)) - : RNZipArchive.zipFolder(normalizeFilePath(source), normalizeFilePath(target)); + ? RNZipArchive.zipFiles( + source.map(normalizeFilePath), + normalizeFilePath(target) + ) + : RNZipArchive.zipFolder( + normalizeFilePath(source), + normalizeFilePath(target) + ); }; export const unzipAssets = (source, target) => { @@ -58,7 +68,10 @@ export const unzipAssets = (source, target) => { throw new Error("unzipAssets not supported on this platform"); } - return RNZipArchive.unzipAssets(normalizeFilePath(source), normalizeFilePath(target)); + return RNZipArchive.unzipAssets( + normalizeFilePath(source), + normalizeFilePath(target) + ); }; export const subscribe = (callback) => {