Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

jieDai's avatar
jieDai
Explorer | Level 3
6 years ago

I had some problems

Hello,

         Once i have integrated the Dropbox Objective-C SDK into my project; I got appkey is ht5jlmr230u0823, and i set up OAuth 2 

Redirect URIs  is https://db-ht5jlmr230u0823. and account_info.write. url scheme is db-ht5jlmr230u0823. [[client.filesRoutes createFolder:@"/test/path/in/Dropbox/account"] setResponseBlock:^(DBFILESFolderMetadata *result, DBFILESCreateFolderError *routeError, DBRequestError *networkError) { if (result) { NSLog(@"%@\n", result); } else { NSLog(@"%@\n%@\n", routeError, networkError); } }]; result is nil.and I created folder ,i got response.but entries is null,and hasMore is no;Printed log:

2020-11-19 20:08:55.165617+0800 TestObjectiveDropbox_iOS[16527:343128] (null)

DropboxAuthError[{

    ErrorContent = "expired_access_token/";

    RequestId = e1b010698acb4729a434e523e9a63ef9;

    StatusCode = 401;

    StructuredAuthError = "<DBAUTHAuthError: 0x600000d418a0>";

    UserMessage = nil;

}];

2020-11-19 20:08:56.947307+0800 TestObjectiveDropbox_iOS[16527:343128] DBSDKReachability Flag Status: -R ------- networkStatusForFlags

2020-11-19 20:08:56.954662+0800 TestObjectiveDropbox_iOS[16527:343128] -canOpenURL: failed for URL: "dbapi-2://1/connect?k=ht5jlmr230u0823&s=" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

2020-11-19 20:08:56.955352+0800 TestObjectiveDropbox_iOS[16527:343128] -canOpenURL: failed for URL: "dbapi-8-emm://1/connect?k=ht5jlmr230u0823&s=" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

2020-11-19 20:09:41.715453+0800 TestObjectiveDropbox_iOS[16527:343128]

 

Success! User is logged into Dropbox.

2020-11-19 20:10:06.103175+0800 TestObjectiveDropbox_iOS[16527:343128] Folder is large enough where we need to call `listFolderContinue:`

 

 

Hope to get your reply!

                                                                                                                                                                                                        Thanks!

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    It looks like there are a few things here, so I'll try to address them each:

     

    First, note that you don't need to register a redirect URI of "https://db-ht5jlmr230u0823" on the Dropbox web site. The SDK and API will handle that for you. You just need to register your URL scheme of "db-ht5jlmr230u0823" as instructed.

     

    The 'account_info.write' scope is only necessary if you need to use the setProfilePhoto method.

     

    You can use the createFolder method to create a folder, but it's better to use the newer createFolderV2. You mentioned "result is nil", so that would indicate an error occurred. You should make sure you also check the routeError and networkError variables for errors.

     

    Your reference to "entries is null,and hasMore is no" sounds like you're referring to the result of a listFolder call. If you called that with the path for a brand new folder, that would be expected, since by default new folders are empty.

     

    The 'expired_access_token' error indicates that the short-lived access token you're using has expired. You can find more information on how this works in the OAuth Guide.

     

    The 'DBSDKReachability' line is just for reference and can be ignored.

     

    The 'canOpenURL: failed for URL' lines can also be ignored. Those indicate that the official Dropbox iOS app is not installed. The SDK will instead use the built-in flow to process the app authorization. The "Success! User is logged into Dropbox." line then does seem to indicate that the authorization flow did work.

     

    The "Folder is large enough" line seems to be some of your own logging indicating that you need to call back to listFolderContinue. Please refer to the listFolder and listFolderContinue documentation for information on using those.

  • jieDai's avatar
    jieDai
    Explorer | Level 3
    6 years ago

    Hello,

             I'm running tests on the simulator. when I used createFolder,  result is nil,routeError is nil,networkError is error.print log:

    <DBFILESCreateFolderError: 0x600003a771c0>

    DropboxHttpError[{

        ErrorContent = "path/conflict/folder/..";

        RequestId = ebdf556d699e4888a0808509712d1287;

        StatusCode = 409;

        UserMessage = nil;

    }];

     and when i used createFolderV2,result is nil,routeError is DBFILESCreateFolderError *0x0000600003a7e000,print log:

    <DBFILESCreateFolderError: 0x600003a7e000>

    DropboxHttpError[{

        ErrorContent = "path/conflict/folder/.";

        RequestId = 2479a33598ae4e909ac96a3032e4f606;

        StatusCode = 409;

        UserMessage = nil;

    }];

     

     

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    A 'path/conflict/folder' error like this indicates "There’s a folder in the way". That is, the folder could not be created because there's already a folder at the specified path. 

  • jieDai's avatar
    jieDai
    Explorer | Level 3
    6 years ago

    Hello,

         A 'path/conflict/folder' error like this indicates "There’s a folder in the way". That is, the folder could not be created because there's already a folder at the specified path.  How can I see the data in my cloud disk, or how to obtain the data in the cloud disk, I want to know how to display the data stored in my cloud disk on my app.  

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!