Would just like to know if there is a batch download method available.
http://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:objc(cs)DBFILESUserAuthRoutes(im)downloadUrl:rev:overwrite:destination:
I have looked through the api but it doesn't seem to exist
And if its not. is a recursive download for batch files the optimal way to download batches of files?
-(void)recursiveDownload:(NSMutableArray<DBFILESMetadata *>*)array position:(int)position hasErrors:(BOOL)hasErrors {
if (array.count == 0) {
[self downloadCompletedAlert];
return;
}
NSString* name = array[position].name;
NSString* photoDropboxPath = [NSString stringWithFormat:@/%@",name];
NSURL* photoURLPath = [[WCPURLHelper applicationPhotoDirectory]URLByAppendingPathComponent:name isDirectory:NO];
[[_dbUserClient.filesRoutes downloadUrl: photoDropboxPath overwrite:YES destination:photoURLPath]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError,
NSURL *destination) {
BOOL hasError = hasErrors;
if (!result) {
NSLog(@%@\n%@\n", routeError, networkError);
hasError = true;
}
_progressHUD.detailsLabelText = [NSString stringWithFormat:@Downloading Photo %d of %zd,position+1,array.count];
if (position+1 == array.count) {
if (hasError) {
[self failedAlertWithDetailLabelText:@Download Failed title:@Photos were not all downloaded message:@There were errors downloading from dropbox];
} else {
[self downloadCompletedAlert];
}
} else {
//stops dropbox from giving the error that there are too many write actions happening
//gives time between photos
[self recursiveDownload:array position:position+1 hasErrors:hasError];
}
}];
}