Giter VIP home page Giter VIP logo

Comments (13)

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024 1

nice, thanks!

from react-native-zip-archive.

cancan101 avatar cancan101 commented on May 26, 2024

The same seems to happen with the file exists but is not a valid zip.

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

@cancan101 I will fix this ASAP.

from react-native-zip-archive.

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024

Also seeing this problem...

But even when the file exists and is a valid zip, this doesn't seem to work... any tips on debugging?

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

@WestleyArgentum I'm using react-native-fs to get access to the zip file on the simulator to check the it. I think any methods which can get path to the zip file is ok.

I would improve this.

from react-native-zip-archive.

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024

I'm using react-native-fs to download the zip, and I use RNFS.readDir to check and make sure the zip file is downloaded correctly... but then when I try to unzip it nothing happens and I don't see any errors...

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

@WestleyArgentum You mean the promise is just hanging?

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

@WestleyArgentum I think maybe you're dong something wrong wth promise code, e.g. not return the promise from the inner promise chain which I have ran into before.

from react-native-zip-archive.

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024

Sorry I disappeared there, but in this case I don't think the error is promise related -- my code is just like the example:

    ZipArchive.unzip(RNFS.DocumentDirectoryPath + '/images.zip', RNFS.DocumentDirectoryPath)
            .then(() => {
                // check to see what exists in the directory...
                RNFS.readDir(RNFS.DocumentDirectoryPath)
                  .then((result) => {
                    // shows images.zip, but not an unzipped folder or any of the contents of the zip...
                    console.log('things in directory:', result);
                });
            })
            .catch((err) => {
                cb(err);
            });

Does that look ok?

from react-native-zip-archive.

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024

Ah, I realized I can use xcode to step through the code and my problem was with directories. Would be really cool to have those errors raised through .catch though

Thanks for your help!

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

@WestleyArgentum oh, can you explain a little bit about your resolution? So I can collect errors should be raised.

from react-native-zip-archive.

WestleyArgentum avatar WestleyArgentum commented on May 26, 2024

So, I've never spent much time in objective c, but I think the problem is here: https://github.com/plrthink/react-native-zip-archive/blob/master/RNZipArchive.m#L19

It looks like these methods take in a pointer to a pointer to an error: https://github.com/plrthink/react-native-zip-archive/blob/fb47345d3094e7e85bf49af747758acea7fe43d3/SSZipArchive/SSZipArchive.m#L47

And that you should pass that in, check if it gets set, and raise an error instead of calling the callback

from react-native-zip-archive.

plrthink avatar plrthink commented on May 26, 2024

fixed with b622cb0

from react-native-zip-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.