cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iOS Obj-C Example of [DBClientsManager unlinkAndResetClients]

iOS Obj-C Example of [DBClientsManager unlinkAndResetClients]

mrobinson
Helpful | Level 6
Go to solution

I downloaded the examples and can't find a instance of how to use this function:

 

This code doesn't not unlink or reset clients: 

 

- (IBAction)didPressUnlink {
    [DBClientsManager unlinkAndResetClients];
    
    linkButton.hidden=NO;
    unlinkButton.hidden=YES;
    
}

 

 

Thoughts?

thanks

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
That "< Dropbox" is a feature of recent versions of iOS. It's a shortcut back to the previous app after you switch between apps. That's a system feature, so I don't believe we have control over it, but it doesn't indicate that you're still in Dropbox.

Regarding the openURL issue, your code looks right. That openURL method should get called after the user authorizes the app to connect to their Dropbox account. What steps are you taking to reproduce this issue specifically? Is nothing getting logged because authResult is nil?

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

There's an example of using unlinkAndResetClients in the sample app here. Your usage looks correct though, and the method is working correctly for me.

 

How are you checking if it worked? You generally should just check if [DBClientsManager authorizedClient] is not nil. Also, what version of the SDK do you have installed? Please update to the latest if you aren't already using it. 

mrobinson
Helpful | Level 6
Go to solution

Hello 

 

I just noticed that my app is has "< Dropbox" in the upper left corner, shouldn't it leave the dropbox app after authentification?

 

It looks like it is "Pushing" to my app instead of leaving dropbox.

 

 

IMG_7578.png

 

It seems to me that something is amiss with the method below:

 

No results are being "NSlogged" upon login:

 

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    DBOAuthResult *authResult = [DBClientsManager handleRedirectURL:url];
    if (authResult != nil) {
        if ([authResult isSuccess]) {
            NSLog(@"Success! User is logged into Dropbox.");
           
        } else if ([authResult isCancel]) {
           
            
            NSLog(@"Authorization flow was manually canceled by user!");
        } else if ([authResult isError]) {
            NSLog(@"Error: %@", authResult);
        }
    }
    return NO;
}

 

Greg-DB
Dropbox Staff
Go to solution
That "< Dropbox" is a feature of recent versions of iOS. It's a shortcut back to the previous app after you switch between apps. That's a system feature, so I don't believe we have control over it, but it doesn't indicate that you're still in Dropbox.

Regarding the openURL issue, your code looks right. That openURL method should get called after the user authorizes the app to connect to their Dropbox account. What steps are you taking to reproduce this issue specifically? Is nothing getting logged because authResult is nil?

mrobinson
Helpful | Level 6
Go to solution

Thanks,

 

The new completion handler (iOS 10)  solved the response problem that was missing.

 

Thanks for your help.

 

Michael

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    mrobinson Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?