Zipping content for API call

#1

I need to call an API that will only accept gzip’d body. I can successfully call the API via curl, but can’t figure out how to get a zip lib imported into my Expo project. I have tried mockingbot/react-native-zip-archive combined with itinance/react-native-fs but I get errors when trying to write a temp file to disk to later zip (I would, of course, prefer to just zip js object in memory).

All the solutions to the error I’m getting involve correctly manually installing the react-native-fs package, but since I’m trying to stick with Expo I’m a bit lost. The react-native-fs error I’m getting is:

cannot read property of RNFSFileTypeRegular of undefined

#2

Hey @jeremym1234,

Any library that requires you to run react-native link or make manually native code changes such as react-native-fs will require you to eject and won’t work with a standard Expo project.

Cheers,

Adam

#3

Thanks Adam, I was figuring that was the case. Are there any zip libraries that could help me avoid doing that? I suppose I could also write an aws lambda to proxy this call but wanted to avoid that complexity.

J.D.

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.