Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

App crashes after file download without DownloadManager (Android) #561

Open
@natashache

Description

@natashache

I'm trying to download files without using the download manager on android. I want to make the files "private" to my app, i.e. I don't want the files to show up in common folders or let users access the files with other apps. So I want to save the files in a custom folder and not show download notifications. If I understand correctly, that means I cannot use the download manager because then I'd have no control of where the file is saved.

But with the config below (download manager set to false), whenever something is downloaded, the app just crashes. And I do not get any error logs.

            await RNFetchBlob
                .config({
                    addAndroidDownloads: {
                        useDownloadManager: false, 
                        notification: false,
                        mime: 'audio/mpeg',
                        description: 'File downloaded by download manager.',
                        path: '/data/data/com.myapp/files/episodes/' + episode.id + '.mp3',
                        mediaScannable : false,
                    }
                })
                .fetch('GET', episode.url, {
                    'Cache-Control': 'no-store'
                })
                .then(...)

Would appreciate any suggestion on this, or if there's an alternative way to achieve the intended goal.

"react": "16.0.0-beta.5",
"react-native": "0.48.4",
"react-native-fetch-blob": "0.10.8".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions