Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
YanivB
2 years agoHelpful | Level 6
reauthorizeClient
Hi, i get access token in my ios app using dropbox api. i want to reauthenticate in the same app on other device using these access token. How can it be done (in Swift code lang) ? all wo...
- 2 years ago
You are awesome !
Thanks the guidance.
YanivB
2 years agoHelpful | Level 6
1. This is the func for the dropboxOAuth process:
2. after a success, i get the Token from here:
3. Than when the app init, I use this reauthorizeClient :
From this point all works well.
The problem is only on the device that the dropboxOAuth process made, when trying on other device non works....
* You suggested to use the DropboxOAuthManager storeAccessToken.
But i dont see the storeAccessToken func gets as parameter a String for the Token value....
So I asked clarification from you please, how to use that func when I have the Token (As String) saved in my app.
thanks in advance!!!
Здравко
2 years agoLegendary | Level 20
YanivB wrote:...
3. Than when the app init, I use this reauthorizeClient :...
Hi YanivB,
Why you decide that reauthorizeClient accepts access token? Take a closer look on method declaration and you'll see it accepts user ID (behind which there should be stored already some access token). In other words, you cannot pass access token in such a way.
By the way, passing access token with string (alone) will limit the time your application will be usable with a single token assignment. All access tokens at present are short lived! Just a reminding that for long term access you will need to deal with refresh token (eventually included within AccessToken object).
- YanivB2 years agoHelpful | Level 6
Hi,
Regarding the "Why you decide that reauthorizeClient accepts access token?" question, because that is the only parameter (As String) i see from SDK that present:- Здравко2 years agoLegendary | Level 20
YanivB wrote:..., because that is the only parameter (As String) i see from SDK that present:
Owo...🤦 You're killing the fish... 😁 Ok, 🤷 ...
YanivB, Let's see what you have up to now: There is an only method that accepts string and that method doesn't work for you. 🤔
Doesn't it sound logical to move the focus from string to object? 🧐 There are methods to get AccessToken object (you have already used such a way; there are others too) and to set it back (as Greg useful proposed DropboxOAuthManager storeAccessToken) instead of using just string. Right? In mean time you can stringify such an object and store it in this form in the source place and after that build it back before use on the corresponding device as well as you can keep it in any other form (matter of choice and design decision, but the object state MUST be complete, not just some part). What would you say? 😉
- YanivB2 years agoHelpful | Level 6
First , thank you all for trying to help!!
Sorry I am new to the swiftyDropbox and not all straight forward to me...
That is why I ask for code examples 🙏
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!