Dropbox library in LC 9 - centralise the access token?
Ben Rubinstein
benr_mc at cogapp.com
Wed Oct 11 14:00:10 EDT 2017
> Does Dropbox limit syncing to a single account?
As far as I know, yes.
That doesn't mean the API enforces this - only that every app and interface
I've come across for it does - you log in as a given account, and you're
operating on that account. There is a folder "~/Dropbox" (or Windows
equivalent), and that's the synced folder. I don't actually know what happens
if, for example on a desktop, you log out of one account and into another -
what it does to the contents of the "Dropbox" folder.
I assume this is by design - the chief virtue of Dropbox is its simplicity.
In principle I think that a new app, e.g. built in LiveCode, could perfectly
happy operate on a number of accounts simultaneously. But my proposal in no
way prevents that - the code that makes a series of calls to the Dropbox API
would precede them with a single call to set the relevant token, rather than
passing that token in every call. This is how Monte's mergDropbox library
worked, for example.
This is also how the AWS library in LC9 works - you call AWSSetCredentials
first, then all subsequent commands/functions operate on that account, until
you call AWSSetCredentials again to switch to another one. There might be some
virtue in consistency!
In the same way, you make one call to cameracontrol to select which camera
subsequent calls refer, rather than passing "front" or "back" in every call.
The same way in the printing library you set the printer you're addressing. Etc..
On 11/10/2017 18:12, Richard Gaskin via use-livecode wrote:
> Ben Rubinstein wrote:
>> The new Dropbox library is (going to be) great. But while it's still only in
>> DP, can I suggest a modest improvement?
>>
>> Every single command in the library takes an access token as the first
>> parameter. Given that most uses of the library will involve multiple calls;
>> and the cases where an app is juggling two different dropbox accounts will
>> surely be vanishingly small; wouldn't it be much more elegant if there was a
>> single command "dropboxSetAccessToken" or similar, to normally be used just
>> once in a session - then every other command would drop that parameter?
>
> Does Dropbox limit syncing to a single account?
>
> Will Dropbox always have that limitation?
>
> FWIW Nextcloud allows any number of folders synced with any number of servers.
>
More information about the use-livecode
mailing list