Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no work in real iphone #184

Closed
cbcye opened this issue Oct 3, 2016 · 1 comment
Closed

no work in real iphone #184

cbcye opened this issue Oct 3, 2016 · 1 comment

Comments

@cbcye
Copy link

cbcye commented Oct 3, 2016

I use the following code to download remote image, it is working on Android and IOS Simulator but didn't work on iphone 5s device(downloaded the image file but not save into local file). any one can give me suggest. I have update to RN0.34 & RNFS 2.0.2rc-2 , it is also happend on RN0.31 & RNFS 1.5.1

       var DownloadFileOptions = {
            fromUrl: url,          // URL to download file from
            toFile: tempImagePath         // Local filesystem path to save the file to
        }
        var result = RNFS.downloadFile(DownloadFileOptions);

        result.promise.then(function (val) {
            Reactotron.log('Success Result:' + JSON.stringify(val));
            var localFilePath = 'file://' + tempImagePath;
            self.setState({
                localImagePath: localFilePath,
                imageLoaded: true,
            });
        }, function (val) {
            Reactotron.log('Error Result:' + JSON.stringify(val));
        }
        ).catch(function (error) {
            Reactotron.error(error.message);
        });
@cbcye
Copy link
Author

cbcye commented Oct 4, 2016

I resolve this issue. on this post:

@cbcye cbcye closed this as completed Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant