Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Mark L.45
9 years agoCollaborator | Level 9
URI HTTPS request
Hi,
I am trying to follow this dropbox tutorial; but with success
https://blogs.dropbox.com/developers/2013/07/using-oauth-2-0-with-the-core-api/
I tried this call using the parameters shown an...
Mark L.45
9 years agoCollaborator | Level 9
Thanks Steve. I like the comment, your code will break :) straight to the point. Reworked it; this is better yes? Also added the check and disabled signup parameter! your help much appreciated!!
var tokenDict : [String:String] = [:]
func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
if (webView.URL?.scheme == "https" && webView.URL?.host == "www.dropbox.com" && webView.URL?.path == "/1/oauth2/redirect_receiver") {
//print(webView.URL?.fragment)
let tokenText = String(UTF8String: webView.URL!.fragment!)
let parsedTokens = tokenText?.componentsSeparatedByString("&")
//print("tokenText \(parsedTokens)")
for token in parsedTokens! {
let tokenP = token.componentsSeparatedByString("=")
tokenDict[tokenP[0]] = tokenP[1]
}
if (tokenDict["state"] == token2Verify) {
token2Save = tokenDict["access_token"]!
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject(token2Save, forKey: "dropBoxAuth")
}
}
progressView.setProgress(0.0, animated: false)
}
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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, Facebook or Instagram.
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!