diff --git a/ObjectiveDropboxOfficial.podspec b/ObjectiveDropboxOfficial.podspec index 11fdd3b6b..38be344c4 100644 --- a/ObjectiveDropboxOfficial.podspec +++ b/ObjectiveDropboxOfficial.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ObjectiveDropboxOfficial' - s.version = '1.0.10' + s.version = '1.0.11' s.summary = 'Dropbox Objective C SDK for APIv2' s.homepage = 'https://dropbox.com/developers/' s.license = 'MIT' diff --git a/README.md b/README.md index 91b4a89bb..4c9010a4f 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ brew install carthage ``` # ObjectiveDropboxOfficial -github "https://github.com/dropbox/dropbox-sdk-obj-c" ~> 1.0.10 +github "https://github.com/dropbox/dropbox-sdk-obj-c" ~> 1.0.11 ``` Then, run the following command to checkout and build the Dropbox Objective-C SDK repository: @@ -447,7 +447,7 @@ NSData *fileData = [@"file data example" dataUsingEncoding:NSUTF8StringEncoding NSLog(@"%@\n%@\n", routeError, error); } }] progress:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) { - NSLog(@"%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded); + NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded); }]; ``` diff --git a/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTasks.m b/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTasks.m index c7a56df2a..803af22ce 100644 --- a/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTasks.m +++ b/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTasks.m @@ -22,13 +22,13 @@ - (DBError *)getDBError:(NSData *)errorData httpHeaders:(NSDictionary *)httpHeaders { DBError *dbxError; - if (statusCode == 200) { - return nil; - } - if (clientError) { return [[DBError alloc] initAsClientError:clientError]; } + + if (statusCode == 200) { + return nil; + } NSDictionary *deserializedData = [self deserializeHttpData:errorData]; @@ -308,7 +308,7 @@ - (DBDownloadUrlTask *)response:(NSOperationQueue *)queue NSString *headerString = [self caseInsensitiveLookup:@"Dropbox-API-Result" dictionary:httpHeaders]; NSData *resultData = headerString ? [headerString dataUsingEncoding:NSUTF8StringEncoding] : nil; - if (!resultData) { + if (clientError || !resultData) { // error data is in response body (downloaded to output tmp file) NSData *errorData = location ? [NSData dataWithContentsOfFile:[location path]] : nil; DBError *dbxError = [self getDBError:errorData @@ -322,25 +322,25 @@ - (DBDownloadUrlTask *)response:(NSOperationQueue *)queue } NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *path = [_destination path]; + NSString *destinationPath = [_destination path]; - if ([fileManager fileExistsAtPath:path]) { + if ([fileManager fileExistsAtPath:destinationPath]) { NSError *fileMoveError; if (_overwrite) { - [fileManager removeItemAtPath:[_destination path] error:&fileMoveError]; + [fileManager removeItemAtPath:destinationPath error:&fileMoveError]; if (fileMoveError) { responseBlock(nil, nil, [[DBError alloc] initAsClientError:fileMoveError], _destination); return; } } - [fileManager moveItemAtPath:[location path] toPath:path error:&fileMoveError]; + [fileManager moveItemAtPath:[location path] toPath:destinationPath error:&fileMoveError]; if (fileMoveError) { responseBlock(nil, nil, [[DBError alloc] initAsClientError:fileMoveError], _destination); return; } } else { NSError *fileMoveError; - [fileManager moveItemAtPath:[location path] toPath:path error:&fileMoveError]; + [fileManager moveItemAtPath:[location path] toPath:destinationPath error:&fileMoveError]; if (fileMoveError) { responseBlock(nil, nil, [[DBError alloc] initAsClientError:fileMoveError], _destination); return; diff --git a/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTransportClient.m b/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTransportClient.m index b3eeee20b..725344501 100644 --- a/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTransportClient.m +++ b/Source/ObjectiveDropboxOfficial/PlatformNeutral/Networking/DBTransportClient.m @@ -10,7 +10,7 @@ #import "DBTasks.h" #import "DBTransportClient.h" -static NSString const *const kVersion = @"1.0.10"; +static NSString const *const kVersion = @"1.0.11"; static NSString const *const kDefaultUserAgentPrefix = @"OfficialDropboxObjCSDKv2"; static NSString const *const kBackgroundSessionId = @"com.dropbox.dropbox_sdk_obj_c_background"; diff --git a/TestObjectiveDropbox_macOS/TestObjectiveDropbox_macOS/ViewController.m b/TestObjectiveDropbox_macOS/TestObjectiveDropbox_macOS/ViewController.m index 8067027c4..cb819149d 100644 --- a/TestObjectiveDropbox_macOS/TestObjectiveDropbox_macOS/ViewController.m +++ b/TestObjectiveDropbox_macOS/TestObjectiveDropbox_macOS/ViewController.m @@ -41,34 +41,25 @@ - (IBAction)linkBrowserButtonPressed:(id)sender { } - (IBAction)runTestsButtonPressed:(id)sender { - DropboxClient *client = [DropboxClientsManager authorizedClient]; - [[client.filesRoutes listFolder:@""] - response:[NSOperationQueue new] response:^(DBFILESListFolderResult *result, DBFILESListFolderError *routeError, DBError *error) { - if (result) { - NSLog(@"%@", [NSThread currentThread]); - NSLog(@"%@", [NSThread mainThread]); - NSLog(@"%@\n", result); - } - }]; -// DropboxTester *tester = [[DropboxTester alloc] initWithTestData:[TestData new]]; -// -// void (^unlink)() = ^{ -// [TestFormat printAllTestsEnd]; -// [DropboxClientsManager unlinkClients]; -// [self checkButtons]; -// }; -// -// switch (appPermission) { -// case FullDropbox: -// [self testAllUserEndpoints:tester nextTest:unlink asMember:NO]; -// break; -// case TeamMemberFileAccess: -// [self testTeamMemberFileAcessActions:unlink]; -// break; -// case TeamMemberManagement: -// [self testTeamMemberManagementActions:unlink]; -// break; -// } + DropboxTester *tester = [[DropboxTester alloc] initWithTestData:[TestData new]]; + + void (^unlink)() = ^{ + [TestFormat printAllTestsEnd]; + [DropboxClientsManager unlinkClients]; + [self checkButtons]; + }; + + switch (appPermission) { + case FullDropbox: + [self testAllUserEndpoints:tester nextTest:unlink asMember:NO]; + break; + case TeamMemberFileAccess: + [self testTeamMemberFileAcessActions:unlink]; + break; + case TeamMemberManagement: + [self testTeamMemberManagementActions:unlink]; + break; + } } - (IBAction)unlinkButtonPressed:(id)sender {