birdofpreyru / react-native-fs

File system access for React Native
https://dr.pogodin.studio/docs/react-native-file-system
Other
121 stars 8 forks source link

Background Downloads Tutorial (iOS) Not Working #27

Closed relaxxpls closed 5 months ago

relaxxpls commented 5 months ago

The documentation here seems to be outdated.

I have tried using the following code

#import <ReactNativeFs.h>

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

This fails aswell due to

No known class method for selector 'setCompletionHandlerForIdentifier:completionHandler:'

@birdofpreyru Are any additional steps needed for iOS?

birdofpreyru commented 5 months ago

The «Background downloads» feature is fixed in v2.23.0 (requires minor changes in the host app code), and it is tested and works for me in the Example App. That does not mean there is no other problems with downloadFile() (i.e. #24) — I haven't looked deeper into that one.