Rn-fetch-blob: Invalid value for visibility : 2

Created on 25 Sep 2018  路  6Comments  路  Source: joltup/rn-fetch-blob

Continuing this from the original repo. This happens downloading files via fetch with rn-fetch-blob. Cannot seem to track down a cause here.

https://github.com/wkh237/react-native-fetch-blob/issues/726

Most helpful comment

If you're using 'addAndroidDownloads' in your RNFetchBlob config then you have to give android permission to DOWNLOAD_WITHOUT_NOTIFICATION in your AndroidManifest.xml

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /

For reference: https://stackoverflow.com/questions/9345977/downloadmanager-request-setnotificationvisibility-fails-with-jsecurityexception

Hope this helps you :)

All 6 comments

If you're using 'addAndroidDownloads' in your RNFetchBlob config then you have to give android permission to DOWNLOAD_WITHOUT_NOTIFICATION in your AndroidManifest.xml

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /

For reference: https://stackoverflow.com/questions/9345977/downloadmanager-request-setnotificationvisibility-fails-with-jsecurityexception

Hope this helps you :)

If you're using 'addAndroidDownloads' in your RNFetchBlob config then you have to give android permission to DOWNLOAD_WITHOUT_NOTIFICATION in your AndroidManifest.xml

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /

For reference: https://stackoverflow.com/questions/9345977/downloadmanager-request-setnotificationvisibility-fails-with-jsecurityexception

Hope this helps you :)

i added the permision into my android manifest but the error still there.. and actually i wanted it to be visible is there any other solution??

solved it.. i change the visibility into visible and the error solve, can try this if really still not working after using all the solution.

@nonoyek where you changed the visibility?

addAndroidDownloads : {
useDownloadManager : true, // setting it to true will use the device's native download manager and will be shown in the notification bar.
notification : true,
description : 'Downloading image.',
},

tested and work fine in android u need to change notification to true

confirmed that
{ addAndroidDownloads: { useDownloadManager: true, notification: true, } }
works.
I suggest notification should default to true if it's not added in the config.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MJXin picture MJXin  路  5Comments

adityakmr7 picture adityakmr7  路  4Comments

bony06aug picture bony06aug  路  3Comments

pstanton picture pstanton  路  3Comments

drewandre picture drewandre  路  4Comments