Forum Discussion

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

Re: -canOpenURL: failed for URL: "dbapi-8-emm://1/connect" - error: "The operation co

Hi, I run through the same problem. Now I have been getting to this screen

 

But then nothing happens when I click on either of the two buttons.

This is the function I have in my app delegate

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
    if let authResult = DropboxClientsManager.handleRedirectURL(url) {
        switch authResult {
        case .success:
            print("Success! User is logged into Dropbox.")
        case .cancel:
            print("Authorization flow was manually canceled by user!")
        case .error(_, let description):
            print("Error: \(description)")
        }
    }
    return true
}

Also my keys are correct
Can you please help out ?

5 Replies

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

    siso Are you getting any errors in the console when you tap one of these?

    When you tap either of these buttons, you should get redirected back to your third party app. To clarify, are you saying that that redirect does not occur, or that it does occur but you just don't get any result in the console?

    If the redirect isn't occurring at all, please make sure you have your app key registered in the "db-" URL scheme under CFBundleURLTypes as documented here: https://github.com/dropbox/SwiftyDropbox#application-plist-file

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

    Nothing happens when I click on the buttons, it does not go back to my app.

    and  my "URL type" is set this way 

    I can't change to 

    CFBundleURLTypes

    it goes back to URL types by itself.

    I did every step listed on the GitHub carefully. I don't see what is happening honestly. 

    Is there another way to go around this?

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

    Thanks, that looks correct. That's the "Property List" view, so Xcode will translate the key names for you. To view the actual XML, where you would see "CFBundleURLTypes", you can right click on your Info.plist and "Open As" > "Source Code".

     

    Anyway, I see you redacted your app key from the screenshot, but can you confirm in your actual app you have it registered without the quotes seen in your screenshot? It should look like "db-a1b2c3d4e5", without quotes, where "a1b2c3d4e5" would be your app key.

     

    Also, can you double check that the app key you have there is exactly the same as the one you pass to DropboxClientsManager.setupWithAppKey?

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

    Yes, that is correct. I went through these steps  and did them how you just mentioned.

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

    Thanks, in that case, can you let me know:

    • what version(s) of iOS are you seeing this issue with? I.e., iOS 13, 12, etc.
    • have you also tried this on a physical device? If so, do you see the issue there as well?
    • does your app use "scenes"?

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!