Skip to content

Commit 9c36c55

Browse files
committed
list the way to works with expo in the doc
1 parent 9ec0811 commit 9c36c55

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Zip archive utility for react-native
66

77
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.
88

9+
## For Expo Users
10+
11+
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.
12+
913
## Compatibility
1014

1115
| react-native version | react-native-zip-archive version |

android/src/main/java/com/rnziparchive/RNZipArchiveModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public void getUncompressedSize(String zipFilePath, String charset, final Promis
421421
long totalSize = getUncompressedSize(zipFilePath, charset);
422422
promise.resolve((double) totalSize);
423423
}
424-
424+
425425
/**
426426
* Return the uncompressed size of the ZipFile (only works for files on disk, not in assets)
427427
*

index.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const normalizeFilePath = (path) =>
1010
path.startsWith("file://") ? path.slice(7) : path;
1111

1212
export const unzip = (source, target, charset = "UTF-8") => {
13-
return RNZipArchive.unzip(normalizeFilePath(source), normalizeFilePath(target), charset);
13+
return RNZipArchive.unzip(
14+
normalizeFilePath(source),
15+
normalizeFilePath(target),
16+
charset
17+
);
1418
};
1519
export const isPasswordProtected = (source) => {
1620
return RNZipArchive.isPasswordProtected(normalizeFilePath(source)).then(
@@ -49,16 +53,25 @@ export const zipWithPassword = (
4953

5054
export const zip = (source, target) => {
5155
return Array.isArray(source)
52-
? RNZipArchive.zipFiles(source.map(normalizeFilePath), normalizeFilePath(target))
53-
: RNZipArchive.zipFolder(normalizeFilePath(source), normalizeFilePath(target));
56+
? RNZipArchive.zipFiles(
57+
source.map(normalizeFilePath),
58+
normalizeFilePath(target)
59+
)
60+
: RNZipArchive.zipFolder(
61+
normalizeFilePath(source),
62+
normalizeFilePath(target)
63+
);
5464
};
5565

5666
export const unzipAssets = (source, target) => {
5767
if (!RNZipArchive.unzipAssets) {
5868
throw new Error("unzipAssets not supported on this platform");
5969
}
6070

61-
return RNZipArchive.unzipAssets(normalizeFilePath(source), normalizeFilePath(target));
71+
return RNZipArchive.unzipAssets(
72+
normalizeFilePath(source),
73+
normalizeFilePath(target)
74+
);
6275
};
6376

6477
export const subscribe = (callback) => {

0 commit comments

Comments
 (0)