Skip to content

Commit

Permalink
Merge pull request #87 from vikas5914/master
Browse files Browse the repository at this point in the history
Fix notification value for android download Manager
  • Loading branch information
Traviskn authored Jul 11, 2018
2 parents 2a81f32 + 521e0c4 commit fb0c5f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ If you're going to access external storage (say, SD card storage) for `Android 5
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

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

```
Expand Down
6 changes: 5 additions & 1 deletion android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ public void run() {
if (options.addAndroidDownloads.getBoolean("useDownloadManager")) {
Uri uri = Uri.parse(url);
DownloadManager.Request req = new DownloadManager.Request(uri);
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
if(options.addAndroidDownloads.getBoolean("notification")) {
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
} else {
req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
}
if(options.addAndroidDownloads.hasKey("title")) {
req.setTitle(options.addAndroidDownloads.getString("title"));
}
Expand Down

0 comments on commit fb0c5f1

Please sign in to comment.