Dropbox integration iOS app

I am trying to to integrate Dropbox (http api) in my iOS-app and having problems with the oAuth2 authorization. I checked the DropboxApi from Intelligent Visibility but this is for OS.
I can’t see how I can get the Access Token from the Redirect Uri.
Can somebody give me an example how to do this.
Thanks for an answer.

If somebody has already done this exact same thing then they might just understand the problems you refer to and be able to help. But if you want help from a broader group it would be better if you could explain more about the issues you are having. The description “having problems” isn’t very helpful (it’s similar to the way end-users report an issue to support by saying “it didn’t work” and offering no other information). It is almost always better in these cases to be specific and include code examples. :slight_smile:

Thank you Jason for your answer.

I don’t have experience with web development. Dropbox doesn’t have a SDK for Xojo so the only option to use Dropbox in my app is using their http api. I use the iOSHTMLViewer to do the Authorization of my app in Dropbox. In this process I have to send a Redirect-uri on which they send me back an Access_Token to be able to do transactions.

My problem is how to catch this message from Dropbox. The only example I have is the DropboxApi from Intelligent Visibility. But the xojo.net.HTTPSocket is different from the used OS HTTPSecureSocket in this project. So, I don’t a clue how to do this.

Dim ClientID as text = “client_id=” + AppKey
Dim ClientSecret as text = “&client_secret=” + AppSecret
Dim ResponseType as text = “&response_type=code”
Dim RedirectURL as text = “&redirect_uri=https://localhost”

Dim AuthURL as text = "https://www.dropbox.com/1/oauth2/authorize?" +ClientID + ResponseType + RedirectURL

When I need to read a response using a Xojo.Net.HTTPSocket, e.g. to retrieve a cookie from a web service, I use:

myCookie = myHTTPSocket.ResponseHeader("Set-Cookie")

I’ll try tomorrow. Thank you Jason.

Herman I haven’t used the Dropbox API using Xojo iOS (Xojo.Core.HTTPSocket), but email me if you are stuck after trying Jason’s recommendation. I know that API really well and I am sure we can help. mikec@intelligentvis.com


I didn’t succeed making this API work. I let it rest for a couple of months but now I saw that Dropbox has Chooser. This is a small framework that enables your app to access Dropbox files on your device. Can this be used within Xojo and how could you implement this?


That’s a pity. Thank you Jean-Paul.