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
squidlauncher64
2 years agoExplorer | Level 3
Dropbox custom URL scheme
I am developing an expo app. It needs to redirect back to the app after users have given authentication. When I was using expo go for basic testing this seemed to work fine but now that I am testing a development build and eventually a production build my process does not seem to work. I can navigate to dropbox.com/oauth2/authorize but returning to the app after receiving permission from the user seems to be the issue.
In my app.json file I have:
"expo": {
"scheme": "myapp",
}
Here is how I build my redirect URI:
import * as AuthSession from 'expo-auth-session';
export function StartupAutheticationScreen() {
const dropboxRedirURI = AuthSession.makeRedirectUri({path: 'Auth'});
}
The authentication process works until i give permission. Once I click 'allow' I am not redirected to my app. Any help would be greatly appreciated. Thanks!
- ЗдравкоLegendary | Level 20
Hi squidlauncher64,
You're providing too few info for what actually you're going to do. Why at all you need special scheme for your application? In general Dropbox API supports only HTTPS scheme as redirect URI and HTTP if the host is 'localhost' only. On mobile devices are supported also 'db-<APP KEY>' schemes. As far as I know no other custom schemes are possible! Anyway, for web applications usually the classical web protocol is enough. 🤔 Or not?
- squidlauncher64Explorer | Level 3
Thank you for replying! This is for an application for mobile devices. I would prefer to be directly routed back to the phone app to handle the access tokens. I guess I could reroute to a website domain I just think it would be cleaner this way. Dropbox did successfully reroute me to the 'expo go' app after authentication and I know that redirect URI was something along the lines of exp://127.0.0.1:19000. The problem is returning back to the app in development and production builds once authentication has completed.
- ЗдравкоLegendary | Level 20
squidlauncher64 wrote:... This is for an application for mobile devices. I would prefer to be directly routed back to the phone app to handle the access tokens. ...
Yes, you can do it. That's exactly what 'db-<APP KEY>' scheme is for (where <APP KEY> is your application's key). Your application should be ready to handle redirect URI like 'db-<APP KEY>://1/connect'. And URL to start from is a bit different (https://www.dropbox.com/1/connect).
Good luck.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,880 PostsLatest Activity: 2 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!