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: 

SwiftyDropBox Auth Hangs

SwiftyDropBox Auth Hangs

westsider
Helpful | Level 5
Go to solution

I'm following the SwiftyDropbox documentation for my project, and have gotten as far as having my app switch to authenticating via web login thru safari but it just hangs there.

 

If I build on an actual device and have the Dropbox app, I log in without a problem but I want the safari / web login to work as well.

 

I've named my app the same in Xcode and Dropbox.

I'm using Alamofire (4.5.1) SwiftyDropbox (4.6.0), Xcode 9.4.1 Swift 4. Deployment target 10.1

Keychain sharing is on.

 

I don't see anything in output to show me where I'm going wrong:

2018-08-17 10:45:08.792346-0500 Pic Droper[9957:299305] -canOpenURL: failed for URL: "dbapi-8-emm://1/connect" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2018-08-17 10:45:08.958285-0500 Pic Droper[9957:299305] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/15slim/Library/Developer/CoreSimulator/Devices/ABA24F85-62A1-4656-AE95-25BF8E735546/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-08-17 10:45:08.959279-0500 Pic Droper[9957:299305] [MC] Reading from private effective user settings.
2018-08-17 10:45:09.018774-0500 Pic Droper[9957:299305] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-08-17 10:45:23.442747-0500 Pic Droper[9957:299305] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

 Podfile:

# Uncomment the next line to define a global platform for your project
  platform :ios, '10.1'

target 'Pic Droper' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Pic Droper
  pod 'SwiftyDropbox'

end

In my app delegate I have the following with my actual api key replaced:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        DropboxClientsManager.setupWithAppKey("api-key-replaced")
        return true
    }

    // 2. Handle redirect back into SDK
    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : 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("\nError In app delegate: \(description)\n")
            }
        }
        return true
    }

In my view controller I'm calling my auth this way:

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(true)
        authDropbox()
    }
    
    // 1. Begin the authorization flow
    func authDropbox() {
        DropboxClientsManager.authorizeFromController(
            UIApplication.shared,
            controller: self,
            openURL: { (url: URL) -> Void in
                UIApplication.shared.open(url, options: [:], completionHandler: { (finished) in
                    if finished {print("finished")}
                })
        })
    }

Any ideas where I am going wrong?

Thanks so much - Wayne

1 Accepted Solution

Accepted Solutions

westsider
Helpful | Level 5
Go to solution

I agree, the issue seems to have resolved itself for the time being. I am able to get a good login from both the browser and the DropBox app, from within my app...

 

Using - 

Alamofire (4.5.1) SwiftyDropbox (4.6.0), Xcode 9.4.1 Swift 4. Deployment target 10.1

I was using the simulator and also and an actual device - iphoneX running 11.4.1

View solution in original post

7 Replies 7

picnicbob
New member | Level 2
Go to solution

We're getting the same problem in our production app that had been working until recently.

The issue seems to be with webkit preventing cross-site-scripting between Dropbox and the Google reCAPTCHA system.

Hopefully this is resolved soon as it is affecting users of our app.

Greg-DB
Dropbox Staff
Go to solution
Thanks for the reports! We'll look into it.

Greg-DB
Dropbox Staff
Go to solution
I'm having some trouble reproducing this. Can you let me know:
- Are you still seeing this issue?
- What specific version(s) of iOS are you seeing it on?
- Are you seeing this in the simulator, or only on the physical devices?

Thanks in advance!

picnicbob
New member | Level 2
Go to solution

The issue seems to have resolved itself for the time being.

This was on multipe iPhones running the latest non-beta iOS 11.4.1, in an iOS sim, and I was able to reproduce it in Safari 11.1.2 ( 13605.3.8 ) on my mac posing as an iOS 11.0 iPhone user agent.

Did you get a Google reCAPTCHA to show at all during login? The issue seemed to be expecting it to be shown when it could not be.

Greg-DB
Dropbox Staff
Go to solution

Thanks for following up! I'm glad to hear this is working now. Please let me know if you see the issue again.

 

For reference, I was able to trigger the reCAPTCHA successfully in my testing.

 

@westsider Likewise, please let me know if you're still seeing this.

picnicbob
New member | Level 2
Go to solution
Ok. I haven't been able to trigger a reCAPTCHA so I can not confirm that that problem has been addressed, only that I can successfully authorize again because no reCAPTCHA is shown.

westsider
Helpful | Level 5
Go to solution

I agree, the issue seems to have resolved itself for the time being. I am able to get a good login from both the browser and the DropBox app, from within my app...

 

Using - 

Alamofire (4.5.1) SwiftyDropbox (4.6.0), Xcode 9.4.1 Swift 4. Deployment target 10.1

I was using the simulator and also and an actual device - iphoneX running 11.4.1

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    westsider Helpful | Level 5
  • User avatar
    picnicbob New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?