Giter Club home page Giter Club logo

dropbox-sdk-obj-c's People

Contributors

alanjrogers avatar benjaminp avatar changusmc avatar cotinyang avatar dennisasan avatar goetzf avatar greg-db avatar hector-dropbox avatar hponde avatar jamesyangf avatar jaquish avatar jiuyangzhao avatar julianlocke avatar lsdimagine avatar michaelpetrov avatar mrrooni avatar northnose avatar palaniraja avatar pbyang avatar roostr avatar scobbe avatar shidong-dropbox avatar shizam avatar starforever avatar tobihagemann avatar tominsam avatar xaphod avatar xuyanke avatar yanks avatar yufeig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropbox-sdk-obj-c's Issues

Podspec has wrong pod name

Hi! Thanks for making an obj-c SDK that we can use for API v2!
Looks like you're "released". I followed instructions for Pods, ie. pod 'ObjectiveDropboxOfficial', but there's no pod known with that name. Looks like in your podspec you're still just called ObjectiveDropbox. Perhaps you didn't rename & push to cocoapods repo yet?

Wrong message - 'Please enter a CAPTCHA response'

Reproduce stage:

  1. Enter wrong password or wrong name.
  2. Enter right name and password.
  3. Show the wrong message 'Please enter a CAPTCHA response', but the CAPTCHA not showing.

How can I resolve the issue? - 'Please enter a CAPTCHA response'

Thank you very much!
dropbox

listFolderContinue - hasMore issue

I have observed infinite loop when using listFolderContinue - call. In my code, I check for DBFILESListFolderResult instance ".hasMore" which returns YES and then pass the ".cursor" to the next call. The result is that I get the files but then I keep seeing hasMore = YES while "entries" is empty. The cursor value always changes from one call to another.

The expected behaviour was that when there are no more entries to receive, hasMore = NO.

Workaround: Continue only if hasMore = YES and entries is not empty.

This was found on Mac OSX Sierra.

header file not found

Hi

I tried to follow the guide on how to integrate into my project (using Carthage), but I'm stuck at the import line:
#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
giving me an error that it cannot be found.

I saw this issue was fixed in 1.1.0 (and I checked the code that is downloaded when running the Carthage update command, and it looks like the above file is marked as public in the project), but it doesn't work.

using another import, like:
#import <ObjectiveDropboxOfficial/DropboxClient.h>
does work.

Thanks,
Yaniv

Can't compile with Carthage

Been having this error:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/[some path]/Vendor/Carthage/Checkouts/dropbox-sdk-obj-c/Source/ObjectiveDropboxOfficial.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74: xcodebuild: error: Unable to read project 'ObjectiveDropboxOfficial.xcodeproj' from folder '/Users/[some path]/Vendor/Carthage/Checkouts/dropbox-sdk-obj-c/Source'. Reason: Project /Users/[some path]/Vendor/Carthage/Checkouts/dropbox-sdk-obj-c/Source/ObjectiveDropboxOfficial.xcodeproj cannot be opened because it is missing its project.pbxproj file.

Is this official release?

  1. ObjectiveDropboxOfficial is not found in CocoaPod, only ObjectiveDropbox is available.
  2. No DropboxSDKImports.h for import.
  3. No DropboxClientsManager class or 'setupWithAppKey' api.

I can't use this SDK, please help!

Creating a folder that already exists yields unexpected error

Hi again! Hope this isn't too many issues filed in one day :)
When attempting to create a folder that already exists, I was expecting something in the routeError that would allow me to detect this, rather than having to look at error and sniff a 409 statusCode.
Is my expectation reasonable?

[[[client.filesRoutes createFolder:subfolderName] response:^(DBFILESFolderMetadata *result, DBFILESCreateFolderError *routeError, DBError *error) {
... <debug breakpoint>
    (lldb) po result
     nil
    (lldb) po routeError
    {
        ".tag" = path;
    }

    (lldb) po error
    DropboxHttpError[{
        ErrorContent = "path/conflict/folder/..";
        RequestId = 53f8e192682948d93f4f925854e530e8;
        StatusCode = 409;
    }];

Why is there an assertion in +[DropboxClientsManager unlinkClients]?

If there're no authorized clients +resetClients is a simple no-op (like it should be), but +unlinkClients crashes due to the failed assertion:

NSAssert(
      [DBOAuthManager sharedOAuthManager] != nil,
      @"Call `[DropboxClient setupWithAppKey]` or `[DropboxClient setupWithTeamAppKey]` before calling this method");

What are the caveats of clearing the empty keychain?

Thanks!

Migrating from v1 to v2 API

I'm working on migrating a Mac project from the v1 to v2 API, and finding it slow going. The API has changed significantly, with the v2 more complex and hard to find documentation and examples.

These are issues I have currently; I'd appreciate advice (and enhancements if missing functionality):

  1. With the v1 API, I used the following call to load metadata only for files that had changed since the previous invocation, using a hash. I don't see any option for that in v2?

    [delegate.restClient loadMetadata:dropboxFolderPath withHash:hash];

  2. The response from the above included a lastModifiedDate property for each item. I see that is available in the debug description of DBFILESMetadata, but I don't see a property for it (either as a string or NSDate).

  3. With v1 I used the following call to get a sharing link, with a flag for a short URL or full URL. I don't see an option for a short URL when calling createSharedLinkWithSettings, or any other way to get one?

    [delegate.restClient loadSharableLinkForFile:dropboxFilePath shortUrl:shortURL];

  4. With v1 I used the following to get a direct link to a document. I don't see an equivalent method in v2, unless that is getTemporaryLink?

    [delegate.restClient loadStreamableURLForFile:dropboxFilePath];

I'd appreciate assistance with these!

Issue with Single Sign-On for Business Account Trial

When utilizing single sign-on, the authentication view that is displayed does nothing after the continue button is selected(a loading spinner is displayed and the button becomes in active). This occurs when the Dropbox application is not installed on the device forcing the sdk to use the internal authentication method. I have tested my use case with the Dropbox application and I am redirected correctly to my single sign-on provider and authentication is successful. Is this a known issue or not currently supported?

App always crashes after many requests.

Hi, my app always crashes after using a while. So I tried to find out why and turn out it seems the SDK always causes my app crash after about 660 download requests.

Here's my experiment to produce the crash.

  1. Putting a lot of files in a Dropbox folder.
  2. Use DBFILESRoutes's downloadData: method to download the file one by one.
    After about 660 requests, the app crashes without reason. The app disconnected to Xcode immediately and Xcode does not point out which part causes the error.

I added two NSLog() before and after calling the response method, and the last printed line is always DOWNLOAD BEGIN when the app crashed. I also tried to sleep the app for 2 seconds between each request but it doesn't help at all. However, the requests work again after app relaunch. Maybe something is wrong in the internal cache?

DBDownloadDataTask* task = [client.filesRoutes downloadData:path];
NSLog(@"DOWNLOAD BEGIN");
[task response:^(DBFILESFileMetadata *metadata,
                 DBFILESDownloadError *routeError,
                 DBError *error,
                 NSData *data) {
    NSLog(@"DOWNLOAD END");
}];

My assumption is that, the SDK will cause app crash as long as about 660 requests are made. No matter the time interval between each request.

`clientModified` never updates after uploading

Hi, @scobbe. I was trying to use the uploadURL:mode:autorename:clientModified:mute:inputURL method with overwrite mode to upload a file and update the clientModified attribute at the same time. However, it seems the clientModified value never updated. The corresponded DBXFILESFileMetadata object always reports the old value no matter how many times I tried to alter it. Does the SDK cache the value somewhere or does the Dropbox will update the value after a long time? Thanks.

Updated:
After some experiments, I found that this issue happens when trying to upload a exact same file to Dropbox. It seems Dropbox server just ignores the uploaded clientModified parameter if there is already a same copy on the server, and keeps the old clientModified value. Can anyone confirm this?

Broken support for iOS 8.4 in a recent update

Now I know why so many users are getting crashes, and Crashlytics isn't picking it up!
Try running your host app with this pod in iOS simulator 8.x ...

dyld: Symbol not found: _NSURLSessionTaskPriorityHigh
  Referenced from: /Users/Tim/Library/Developer/CoreSimulator/Devices/F18A24E9-B7E4-4A61-9CB2-F67BD786EFCB/data/Containers/Bundle/Application/96BFF07D-E764-43B6-8CE1-7DE90B974479/Photobooth.app/Frameworks/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
 in /Users/Tim/Library/Developer/CoreSimulator/Devices/F18A24E9-B7E4-4A61-9CB2-F67BD786EFCB/data/Containers/Bundle/Application/96BFF07D-E764-43B6-8CE1-7DE90B974479/Photobooth.app/Frameworks/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial

Umbrella header file?

Small improvement suggestion: create a "Dropbox.h" which imports all the necessary header files, using #ifdef to determine platform if necessary.

Example why: I import the header file mentioned in the tutorial, I attempt the tutorial code [[[client.filesRoutes createFolder... to create a folder, and I get a compile error of Property filesRoutes cannot be found in forward class object 'DropboxClient'.

Crash on macOS 10.10

Apple just rejected an app with the Dropbox SDK, as it crashed when running on macOS 10.10.5.

Your documentation says it supports macOS 10.10+, though the Deployment Target in the project is set to 10.11.

Crash report excerpt:

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Symbol not found: ___NSArray0__
  Referenced from:     /Applications/zCloud.app/Contents/MacOS/../Frameworks/ObjectiveDropboxOfficial_macOS.framework/Versions/A/ObjectiveDropboxOfficial_macOS (which was built for Mac OS X 10.11)
  Expected in: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 in /Applications/zCloud.app/Contents/MacOS/../Frameworks/ObjectiveDropboxOfficial_macOS.framework/Versions/A/ObjectiveDropboxOfficial_macOS

I'll try changing the Deployment Target to 10.10, though I'm not certain that's all that's required.

Don't embed Reachability

This causes duplicate symbols when using Reachability in our main app. Please either make it an explicit dependency, or rename the class to avoid conflicts.

How to share an uploaded file that the server auto-renamed?

Sorry if I overlooked something obvious...
I need to upload a file and then share it. Sounds simple but not when server-renaming is desired & switched on.

Steps:

  1. I upload a file, with the policy that the server should rename if there is a collision (there's a high chance there will be a collision in this app, so renaming is necessary)
  2. In the return of uploadURL, I only get a DBFILESFileMetadata, which doesn't contain what the server actually named the file. So there is no way to determine if the server has renamed the file, so I cannot use the path as input to the share command. I can see DBFILESFileMetadata.id_, but I cannot see how to use id_ to init anything useful.

How can I share a file that i've uploaded that the server renamed?

thx

Crash on nil progressHandler

I don't use progressHandlers. This crashes currently because the handler block is set as an object in an NSDictionary, which throws an uncaught exception when nil.

I made a pull-request to fix this: #18

Upload error

Hello to all,
I'm implementing the project within my app. I have a problem during the upload of a file on Dropbox.

This is the code I use

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    NSString *pathDB = [documentsDir stringByAppendingPathComponent:@"archive.sql"];

    [Archivio getInitialDataToDisplay:pathDB writeOnfile:YES];

    NSString *path = [documentsDir stringByAppendingPathComponent:@"backup_archive.txt"];

    if ([DropboxClientsManager authorizedClient] != nil || [DropboxClientsManager authorizedTeamClient] != nil) {
        NSData *fileData = [NSData dataWithContentsOfFile:path];
        [[[client.filesRoutes uploadData:@"/archive" inputData:fileData]
          response:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBError *error) {
              if (result) {
                  NSLog(@"%@\n", result);
              } else {
                  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);
          }];

and that the error I get

   ".tag" = path;
     path =     {
         reason =         {
             ".tag" = conflict;
             conflict =             {
                 ".tag" = folder;
             };
         };
         "upload_session_id" = AAAAAAAAGSOLDdsRysL2YQ;
     };
 }
 DropboxHttpError[{
     ErrorContent = "path/conflict/folder/...";
     RequestId = 32deffe21bf9b202f172de351510e1f3;
     StatusCode = 409;
 }];

How can I fix?

DBReachability status enumerators conflict with Reachability status enumerators

The fix for #37 does not appear to add prefixes to the actual status values { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN }. These conflict with the status values in Reachability and cause the build error Redefinition of enumerator.

Maybe change them to { DBNotReachable = 0, DBReachableViaWiFi, DBReachableViaWWAN }?

Thanks!

Something wrong with repo for stone

The stone item in the repo web view is listed as stone @ aa400c5, and shows a 404 when clicked. Cloning the project in GitHub Desktop shows an uncommitted change (that I didn't do):

- Subproject commit aa400c5a23a2c4822c77c3bcab87703bea4bfa48
+ Subproject commit a69b888936a8a69037cadb72ebb6679efc8d0d8f-dirty

Get name of logged in user

How do I get the name of logged in user. I am trying with below code and I think something is missing implementing completion handler.

DropboxClient *client = [DropboxClientsManager authorizedClient];
client.usersRoutes.getCurrentAccount:^(DBUSERSAccount *account, DBNilObject *error) {
};

Can someone Help?

Thanks,
Pratik

Path expression for the root folder

When trying to list the contents of the root folder, it has to be specified @“” rather than @“/“. If specified @“”, following error occurs
[client.filesRoutes listFolder:@"/"]
Error loading metadata: DropboxBadInputError[{
ErrorContent = "Error in call to API function "files/list_folder": request body: path: Specify the root folder as an empty string rather than as "/".";
StatusCode = 400;
}];

Thought the SDK doesn’t like the leading slash,,, However, to display the contents of folder named ‘test’ under root, if I specify the folder name as ’test’, following error occurs,
[client.filesRoutes listFolder:@“test”]

DropboxBadInputError[{
ErrorContent = "Error in call to API function "files/list_folder": request body: path: ‘test’ did not match pattern '(/(.|[\r\n]))?|(ns:[0-9]+(/.)?)'";
StatusCode = 400;
}];

So, this case I have to specify the folder as ‘/test’. this is confusing but is it working as expected?
In V1, I needed to specify ‘/‘ for the root folder.

Env : Version 1.0.8, iOS, cocoapods

Failed to download files

Hi, I was trying to download a file but always failed to access the downloaded file contents. I tried downloadURL:overwrite:destination:, it did return a response with correct metadata and no errors. But still, the file at the url it returned never exists. I also tried the downloadData: method. There is no error as well but the returned data is always nil.

It seems the error happens in DBXDelegate's URLSession:downloadTask:didFinishDownloadingToURL: method.

- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
    NSLog(@"1: exists(%d)", location, [[NSFileManager defaultManager] fileExistsAtPath:location.path]);
    NSString *sessionId = [self getSessionId:session];
    NSNumber *taskId = [NSNumber numberWithUnsignedInteger:downloadTask.taskIdentifier];
    [_delegateQueue addOperationWithBlock:^{
        NSLog(@"2: exists(%d)", location, [[NSFileManager defaultManager] fileExistsAtPath:location.path]);
        void (^completionHandler)(NSURL *, NSURLResponse *, NSError *) = _downloadTasks[sessionId][taskId][kCompletionHandlerKey];
        completionHandler(location, downloadTask.response, nil);
        [_downloadTasks[sessionId] removeObjectForKey:taskId];
    }];
}

I added two NSLog() to the method and it prints...

1: exists(1)
2: exists(0)

The downloaded file is gone in ``_delegateQueue's operation block. Once I executed the completion handler without running in the _delegateQueue`. The issue no longer exists, I can receive the downloaded file in my response callback as expected. It seems iOS just deleted the temporary file as soon as exiting the delegate method as discussed here: http://stackoverflow.com/questions/22278407/nsurlsessiondownloadtask-downloads-but-ends-with-error

Failed to cancel a file download

Hi all,

I have issue in case when file downloding should be cancelled by user:
NSInvalidArgumentException (reason: '*** -[NSFileManager moveItemAtPath:toPath:error:]: source path is nil’) in
- (DBDownloadUrlTask *)response:response:

It happens in following part of code in your library:

// str 343 
NSError *fileMoveError;
[fileManager moveItemAtPath:[location path] toPath:path error:&fileMoveError];
if (fileMoveError) {
    responseBlock(nil, nil, [[DBError alloc] initAsClientError:fileMoveError], _destination);
    return;
}

I use following method for download: downloadUrl: overwrite: destination:

// Download to NSURL
 DBDownloadUrlTask * downloadUrlTask = [[[client.filesRoutes downloadUrl:path overwrite:YES destination:outputUrl]   response:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBError *error, NSURL *destination) {
//processing  result    
}] 
progress:^(int64_t bytesDownloaded, int64_t totalBytesDownloaded, int64_t totalBytesExpectedToDownload) {
    NSLog(@"%lld\n%lld\n%lld\n", bytesDownloaded, totalBytesDownloaded, totalBytesExpectedToDownload);
}];

and this one for cancel

// Cancel
[downloadUrlTask  cancel];
downloadUrlTask = nil;

Delete multiple files/folders at once

There's a method in Dropbox API called /delete_batch which is pretty useful for deleting multiple items with just one network request. It would be nice to see this API wrapped into the SDK.

I'm aware that this method alone is not enough and you also need to call /delete_batch/check in order to figure out the current status of a deletion job.

Thank you!

`client_modified` does not match format error.

Hi, I got an error message when trying to upload a file. It seems something is wrong when converting the NSDate object.

Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": client_modified: time data '2016-09-08T8:38:19 PMZ' does not match format '%Y-%m-%dT%HM:%SZ'.

ObjectiveDropboxOfficial_macOS.h doesn't exist

Hello !

I'm using the SDK for both iOS & macOS. Everything is fine for my iOS target but, on macOS, the ObjectiveDropboxOfficial_macOS.h file is nowhere to be found. I checked every directories and it's not there. The ObjectiveDropboxOfficial pod is at version 1.0.8. Some verbose from pod update:

  - Installing target `ObjectiveDropboxOfficial-OSX` OS X 10.10
  - Installing target `ObjectiveDropboxOfficial-iOS` iOS 8.0

I could include DropboxSDKImportsDesktop.h manually but that's not the point.
I'm using Xcode 8, cocoapods 1.0.1, OSX 10.11.6. Deployment target set to 10.11.

My Podfile is fine (got the macOS & iOS pods referenced), not sure what is going wrong.
Is this a known issue ?

Thank you !
Mathieu.

How to check which file is latest local or the one inside dropbox folder?

I am working on project where I have to upload/download files between my iOS device and dropbox folder.

Now I have a file named "Filename.txt" in my iOS app as well as in my dropbox folder.

How do I check which one is latest copy?

In dropbox api v1 there was a property called "revision" = "123" which was number and now that is deprecated and a new property called "rev" = "f30099771a" is there but I can't figure it out how to use that.

Please someone help.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.