Skip to content

Commit 2639523

Browse files
author
undefined
committed
Add support for android 14
1 parent cf9e884 commit 2639523

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ public void run() {
196196
DownloadManager dm = (DownloadManager) appCtx.getSystemService(Context.DOWNLOAD_SERVICE);
197197
downloadManagerId = dm.enqueue(req);
198198
androidDownloadManagerTaskTable.put(taskId, Long.valueOf(downloadManagerId));
199-
appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
199+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
200+
appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), Context.RECEIVER_EXPORTED);
201+
} else {
202+
appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
203+
}
200204
return;
201205
}
202206

0 commit comments

Comments
 (0)