I am converting to objective C API v2. I wrote this route to verify if a file is in a dropbox directory called DA. I get on the NSLog that the file exits, but the BOOL return value of the function is always 0. Any help would be appreciated.
- (BOOL)verifyFileInDropboxWith:(NSString *)fileName {
__block BOOL fileOnDB = NO;
NSString *dBFilePath = [NSString stringWithFormat:@/DA/%@",fileName];
DropboxClient *client = [DropboxClientsManager authorizedClient];
[[client.filesRoutes getMetadata:dBFilePath]
response:^(DBFILESMetadata *result, DBFILESGetMetadataError *routeError, DBError *error){
if([result.name containsString:fileName])
{
NSLog(@File already exists DB);
fileOnDB = YES;
} else {
NSLog(@File does not exist in DB);
fileOnDB = NO;
}
}];
return (fileOnDB);
}