You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

smithmsdb's avatar
smithmsdb
Explorer | Level 3
8 years ago

Dropbox api redirecting/opening the wrong Mac OS app

Why is the Dropbox api redirecting to the wrong app?

 

I created a desktop Mac OS app called "DBMacApp" for testing purposes.

I worked through the tutorial at https://github.com/dropbox/dropbox-sdk-obj-c and pointed this test app to my existing Dropbox app called "ezReceipt".

 

Now I am trying to point to another app called "ezReceiptMac" to the same Dropbox app called "ezReceipt".

 

When I run and activate Dropbox from "ezReceiptMac" it still asks to grant permission to the old app called "DBMacApp" as follows:

 

Do you want to allow this page to open "DBMacApp"?  Cancel/Allow

 

If I click on "Allow" it opens the old app "DBMacApp" instead of the new app "ezReceiptMac" that is currently running.

 

Why is the old app being triggered to open while running the new app?

 

Thanks in advance

 

 

 

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The app authorization flow redirect is directed by the db-<APP_KEY> URL scheme registered in an app's plist file, in the CFBundleURLTypes section.

     

    It sounds like you have the same app key registered in both DBMacApp and ezReceiptMac, causing the undesired redirect. Since DBMacApp was just for testing, the easiest solution is to just delete it. If you do want to keep it around for further testing, you should update it to put in a different app key instead.

    • smithmsdb's avatar
      smithmsdb
      Explorer | Level 3

      OK, I deleted the <APP_KEY> from the plist of DBMacApp then in addition trashed it for good measure.

      Unfortunately ezReceiptMac is still prompting to open the old app...  Do you want to allow this page to open “DBMacApp”?

       

      Where DBMacApp is the old test app.

       

      Not sure what I am missing?

    • smithmsdb's avatar
      smithmsdb
      Explorer | Level 3

      My Mac OS app is sandboxed so once I enabled "Incoming" and "Outgoing" Connections and cleaned the project it worked... well sort of.

       

      When I try to Allow a connection to Dropbox with the new app "ezReceiptMac" using the below code snippet I now get: Do you want to allow this page to open “(null)”?  Cancel/Allow.

       

      If I choose "Allow" I am never directed back to the app. Why would it be saying "null" for the app name?

       

       [DropboxClientsManager authorizeFromControllerDesktop:[NSWorkspace sharedWorkspace]
                                                     controller:self
                                                        openURL:^(NSURL *url){ [[NSWorkspace sharedWorkspace] openURL:url]; }
                                                    browserAuth:YES];

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 5 hours ago
333 Following

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 or Facebook.

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!