Преглед изворни кода

Check if addAndroidDownloads map has notification key before consuming

Bhavik Patel пре 5 година
родитељ
комит
d7dd38f9a9
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 1
- 1
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java Прегледај датотеку

@@ -160,7 +160,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
160 160
             if (options.addAndroidDownloads.getBoolean("useDownloadManager")) {
161 161
                 Uri uri = Uri.parse(url);
162 162
                 DownloadManager.Request req = new DownloadManager.Request(uri);
163
-                if(options.addAndroidDownloads.getBoolean("notification")) {
163
+                if(options.addAndroidDownloads.hasKey("notification") && options.addAndroidDownloads.getBoolean("notification")) {
164 164
                     req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
165 165
                 } else {
166 166
                     req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);