Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

Robert S.138's avatar
Robert S.138
Helpful | Level 7
9 years ago

authorizeFromController problems with Covenent Eyes

I just heard from a user of my Objective-C app that when my app tries to link to Dropbox, nothing happens.  I am using:

 

[DropboxClientsManager authorizeFromController:[UIApplication sharedApplication]
    controller:self
    openURL:^(NSURL *url){ [[UIApplication sharedApplication] openURL:url]; }
    browserAuth:YES];

and this works all the time, except for this one user.  It turns out he has installed the alternate browser "Covenent Eyes" and disabled Saffari on his iPhone.  I suggested that he try installing the Dropbox app on his device first, so that the authorization will come from there rather than from the browser.  I have not heard back from him, so I suppose it worked.

 

My question is, can I determine in code if this is happening?  If I can, then I can display a message to users advising them to install the Dropbox app or re-enable Saffari.  What is the cleanest solution to this?

 

-Robert Scott

 Hopkins, MN

 

6 Replies

  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    9 years ago

    Wait a minute.  authorizeFromController is your API.  I don't know what it translates into in terms of pure Apple functions.  I can't very well take this question to an Apple forum unless I can present the problem using only non-Dropbox concepts.  It is not obvious to me that authorizeFromController is equivalent to "Presenting External Application", be it Saffari or some other browser.  If you guys can't give me a little more to go on, I can't really pursue this anywhere else.

     

    -Robert Scott

     Hopkins, MN

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Apologies, I thought you wanted a general way to detect the Safari restriction for use in your app code.

    I've also reported this to the team to see if we can detect this on our side. The authorizeFromController method is designed to use either the official Dropbox app or Safari to process the authorization flow. Lacking either, I don't know if there's a way to use a third party browser like that, but I'll let the team investigate.
  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    9 years ago

    My needs are actually simpler than that.  I just need to know when it isn't going to work.  Then I can display a message to the user explaining the problem.  I can tell them to either install the Dropbox app or enable Safari.  I don't really need the Dropbox API to try any heroics with a browser that is probably designed to make things like this difficult.

     

    -Robert Scott

     Hopkins, MN

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Understood, thanks!
  • Stephen C.14's avatar
    Stephen C.14
    Icon for Dropbox Staff rankDropbox Staff
    9 years ago

    Hi Robert,

     

    I looked into this issue. It's going to be hard on our end to detect this case, but what you can do is check the success of the `openURL` call you make in the closure that you pass the SDK.

     

    For example:

     

    [DBClientsManager authorizeFromController:[UIApplication sharedApplication]
                                          controller:self
                                             openURL:^(NSURL *url) {
                                               BOOL openURLCallSucceeded = [[UIApplication sharedApplication] openURL:url];
                                               NSLog(openURLCallSucceeded ? @"Yes" : @"No");
                                             }
                                         browserAuth:YES];

     

     

    Here, you can use `openURLCallSucceeded` to determine whether or not to show an error message or something. Unfortunately, Apple doesn't make it easy for us to seemlessly pivot to another third-party browser.

     

    Would this be satisfactory for you?

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,039 PostsLatest Activity: 2 days ago
415 Following

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 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!