Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
whats
2 years agoExplorer | Level 4
Xcode swiftydropbox setup
Hey, Has anyone been able to set up Swiftydropbox without any user prompt ? I dont know the order or what needs to be called. I don't want the user to have to set up any login. Any quick breakdow...
Здравко
2 years agoLegendary | Level 20
whats, If it's so hard for you to add support for app secret, then perform OAuth flow using PKCE (as I mentioned it as a variant before). In such a way you wouldn't need app secret and can use Dropbox Swift SDK as is (without change). You don't need to implement such a flow in the same language. Throughout the forum and other SDKs are lot of examples you can "hire". For instance take a look here. It's a Python script that you can perform OAuth on (it uses PKCE). Once you authenticate yourself, get the saved refresh token and use it. 😉 In such a case only app key would be needed - something Dropbox Swift SDK supports. That's it.
Hope this helps.
PS: Keep in mind that providing this application to somebody else will let other person access to your account - something potentially dangerous for your data - take care.
whats
2 years agoExplorer | Level 4
Hey Здравко would this be the right approach? I would then call client.upload for a rough example. I have the manually obtained refreshToken and appKey
class <CLASSNAME>: TransportClient{
private var client:DropboxClient
init(){
client=DropboxClient(appKey:"<APPKEY>",refreshToken:"<REFRESHTOKEN>")
}
}
extension DropboxClient{
public convenience init(appKey:"<APPKEY>",refreshToken:"<REFRESHTOKEN>"){
let transportClient=DropboxTransportClientImpl(transportClient:transportClient:)
self.init(transportClient:transportClient)
}
}
extension DropboxTransportClientImpl{
public convenience init(appKey:"<APPKEY>",refreshToken:"<REFRESHTOKEN>"){
let oauthManager=DropboxOAuthManager(appKey:"<APPKEY>",secureStorageAccess: SecureStorageAccesDefaultImpl.init())
var dropboxToken=DropboxAccessToken(accessToken:"",uid:"",refreshToken:"<REFRESHTOKEN>")
oauthManager.refreshAccessToken(dropboxToken,scopes:[],queue:nil,completion:{_in})
let accessTokenProvider=ShortLivedAccessTokenProvider(token:dropboxToken,tokenRefresher:oauthManager)
self.init(accessTokenProvider:accessTokenProvider,selectUser:nil,pathRoot:nil)
}
}
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!