You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
aesqe
6 months agoExplorer | Level 4
React Native: is it possible to invoke the installed Dropbox mobile app to authorize a user?
Hello 🙂
I'm working on a React Native app which supports backing up files to Dropbox.
I'm using the react-native-app-auth library to authorize my app for access to DB and it all works fine and I get the token, but the authentication form opens up in the browser via http.
I've tried using the Linking class from react-native to call Linking.openURL("dbapi-2://1/connect"), but that just opens up the Dropbox app and nothing more.
Is there a way to invoke the installed Dropbox mobile app to authorize an app/user?
Thanks!
- Greg-DBDropbox Staff
aesqe The "dbapi" authorization flow you're referring to is a special flow that uses the official Dropbox mobile app, and is built for use by the official Dropbox SDKs on mobile (SwiftyDropbox, dropbox-sdk-obj-c, and dropbox-sdk-java).
Dropbox does not offer official documentation or support for third parties to use that directly, but I'll pass this along as a request for official documentation and support for that. I can't promise if or when that might be released though.
- aesqeExplorer | Level 4
Thank you both very much for you input!
Здравко looking at SwiftyDropbox code, it seems like I'll need to calculate the code verifier and code challenge; I'll see if I can somehow grab that from the RN auth library so I don't have to duplicate it in JS, which would be a pain.
Greg-DB just a simple example of what the URI should look like in the docs would be extremely helpful, thank you for passing along the request!
If I manage to resolve this on my own, I'll post an update here 😊
- ЗдравкоLegendary | Level 20
aesqe wrote:... looking at SwiftyDropbox code, it seems like I'll need to calculate the code verifier and code challenge; ...
Actually you don't need it, aesqe, but is advisable. You do it when/if need/want use PKCE code flow - again something advisable, not mandatory.
aesqe wrote:... I'll see if I can somehow grab that from the RN auth library so I don't have to duplicate it in JS, which would be a pain.
...
You can "grab" it, ready for use, from different places, including Dropbox Javascript SDK. 😉
By the way, I pointed you to Dropbox Swift SDK only for authorization URI format only, that what asked for at that moment. You may use any other places for examples source though; preferably in JS of course.
Hope this clarifies matter.
- ЗдравкоLegendary | Level 20
aesqe wrote:...
I've tried using the Linking class from react-native to call Linking.openURL("dbapi-2://1/connect"), but that just opens up the Dropbox app and nothing more.
...
Hi aesqe,
Ok, but how do you expect Dropbox application to know what exactly you want to connect to your account? 🤔 Is that entire URI? You may need to pass as query params some more information about your application to official Dropbox application (the application key at least). 😉
Good luck.
- aesqeExplorer | Level 4
Hi Здравко 👋 🙂
I can pass anything that's needed via that call, but I can't find anything in the documentation about it, so I don't know how to format it. I'll try just appending vars like in the http API calls, maybe something will work 🤔
Thanks for the suggestion, I'll let you know if I find a proper URI format 😁
- ЗдравкоLegendary | Level 20
aesqe wrote:..., but I can't find anything in the documentation about it, so I don't know how to format it. ...
Yeah, Dropbox documentation is very "tiny", unfortunately. Many available and used features are completely undocumented, like the discussed one (but not only). Fortunately for some of them info could be discovered in published code. Not all features have such an option, but you are lucky now. 😉 Investigate Dropbox Swift SDK relevant code I referred and reimplement it on your own.
Hope this helps.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,885 PostsLatest Activity: 10 hours agoIf 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 or Facebook.
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!