Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Auth(iOS) is not working, if the Dropbox app was installed #345

Closed
mammaiap opened this issue Nov 3, 2021 · 1 comment
Closed

Comments

@mammaiap
Copy link

mammaiap commented Nov 3, 2021

  1. if "dropbox" app was already installed, then it wont proceed to show the "Authentication screen"
  2. if "dropbox" app was not installed, then there is no problem.(it shows the Authentication screen)

->> i followed exact steps which you guys are described in the tutorials ... (thats why it is working for "non Dropbox app installed" iOS devices.

here is the code snippets related to authentication workflow
in AppDelegate.m (in objective c)

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    [PhotoPickerEngine.sharedEngine setupSocialNetworks];
    }

  • (BOOL)application😞UIApplication *)app openURL😞NSURL *)url options😞NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
    {

NSString *urlString = [[[url absoluteString] componentsSeparatedByString:@":"] objectAtIndex:0];

if ([urlString isEqualToString:@"db-xxxxxxxxxx”])

{

[PhotoPickerEngine.sharedEngine handleRedirectURLWithUrl:url]; //dropbox to handle

}

}

//swift code

@objc public func setupSocialNetworks()

{
DropboxClientsManager.setupWithAppKey(“APP_KEY”)
}

@objc public func handleRedirectURL( url: URL)
{
DropboxClientsManager.handleRedirectURL(url, completion: { (authResult) in

        switch authResult {

        case .success(let token):

            print("Success! User is logged into Dropbox with token: \(token)")

            EventHub.post(DropboxLoginEvent())

            UserDefaults.standard.set(token.accessToken, forKey: Constants.keyAccessTokenDropbox)

        case .cancel:

            print("User canceld OAuth flow.")

        case .error(let error, let description):

            print("Error \(error): \(String(describing: description))")

        case .none:

            break

        }

    })

}

the version number of the Dropbox SDK : 6.0.3

the version number of the Dropbox iOS app : 258.2.2

the version number of iOS : 15.0.1

can you please help me to fix this issue?

Thanks ,
Muthulingam

@greg-db
Copy link
Contributor

greg-db commented Nov 3, 2021

[Cross-linking for reference: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/iOS-Problems-connecting-from-own-app-to-Dropbox-when-Dropbox-App/m-p/554844/highlight/true#M26295 ]

I see you also posted on an existing thread on the Dropbox forum regarding this, so I'll close this out and follow up with you there. For future reference, it's not necessary to share reports like this in multiple places.

@greg-db greg-db closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants