Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Permission issue on iOS #87

Open
3 tasks done
vladromila opened this issue Sep 27, 2020 · 4 comments
Open
3 tasks done

Permission issue on iOS #87

vladromila opened this issue Sep 27, 2020 · 4 comments

Comments

@vladromila
Copy link

vladromila commented Sep 27, 2020

Is this a bug report, a feature request, or a question?

Bug Report

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

iOS

Is the bug related to the native implementation? (NSURLSession on iOS and Fetch on Android)

Yes

Environment

Environment:
React native: 0.63.2
react-native-background-downloader: 2.3.4

Target Platform:
iOS (14.0)

Expected Behavior

Simply download the file, exactly how it works on ios simulator

Actual Behavior

The download process runs until 100% and finishes with the following error:
"Download canceled due to error: “CFNetworkDownload_hKBCap.tmp” couldn’t be moved because you don’t have permission to access “87E1D77A-848E-4423-8001-7C3C4A35B6F3”."

Steps to Reproduce

1.Add the library
2.Run the app from xcode to a real device trough usb

@mehrabiani
Copy link

This happens to me too. But only on the device but and on simulation true !

@mehrabiani
Copy link

iOS - Extra Mandatory Step

In your AppDelegate.m add the following code:

..
#import <RNBackgroundDownloader.h>

...

- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
{
  [RNBackgroundDownloader setCompletionHandlerWithIdentifier:identifier completionHandler:completionHandler];
}

...

Failing to add this code will result in canceled background downloads.

and only use RNBackgroundDownloader.directories.documents for destination.

@ShekharD175
Copy link

with iOS 14.3 that method is not getting called. still facing the same issue

@devpascoe
Copy link

If it helps, my simulator didnt progress past requesting to download. Had to delete simulator app and reinstall, now working fine.
Device working fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants