iOS Tutorial DropboxSync Tutorial

Dropbox has dropped support for this API. It doesn't work anymore.

The iDropboxSync library allows you to use Dropbox Sync service to manage an app specific folder inside the user Dropbox account.

It is similar to B4A DropboxSync library: http://www.b4x.com/android/forum/threads/dropbox-sync-library.30112/

The user can easily access these files from any device or computer:

SS-2014-11-17_10.20.03.png


When the user runs the app for the first time they will be asked to grant access to your app. If Dropbox app is installed then the user only needs to click on the button. Otherwise they will need to log-in to their account.

You can see the authorization step in this video:


Using this library

1. You need to register an app with Dropbox that has access to a unique folder:
https://www.dropbox.com/developers/apps
You need to get two values: app key and app secret.

2. If you are using a local mac builder then you need to download the SDK to your Mac computer and copy Dropbox.framework to the Libs folder.

3. The authorization step happens outside of your app. To allow Dropbox app (or the browser) to return back to your app you need to add the following attribute:
B4X:
#UrlScheme: db-ret331arjio70t6
Change the value after db- to your app key.

Application_OpenUrl will be called after the authorization step. You need to call manager.HandleOpenUrl:
B4X:
Private Sub Application_OpenUrl(Url As String, Data As Object) As Boolean
   Log("openurl: " & Url)
   manager.HandleOpenUrl(Url)
   Return True
End Sub

The AccountReady event is raised when the account is ready or when there was a problem with linking the account.
Now you can download or upload files to the account and manage your app specific folder.

When you download a file the DownloadCompleted event is raised when the file is ready. Note that the library always checks that the file is up to date (similar to B4A AutoSync flag).
 

Attachments

  • DropboxSync.zip
    52.2 KB · Views: 609
Last edited:

Albi

Active Member
Licensed User
Longtime User
i was sure that was the first thing i tried, but obv not!
EDIT: that was the problem, and it now works. Thanks very much!!

Am trying to change that now, but for some reason am getting a different error:

[ERROR] DropboxSDK: unable to link; app isn't registered for correct URL scheme (db-MYCODEHERE)

I haven't changed anything else so not sure why it's not linking any more...
 
Last edited:

Albi

Active Member
Licensed User
Longtime User
yeah I had. I had it commented out the first couple of times I was getting that error, but then noticed and included it, but it still wasn't working.
i've just tried now and it's working again - as soon as I started the app the authorisation screen appeared.
 

imbault

Well-Known Member
Licensed User
Longtime User
The iDropboxSync library allows you to use Dropbox Sync service to manage an app specific folder inside the user Dropbox account.

It is similar to B4A DropboxSync library: http://www.b4x.com/android/forum/threads/dropbox-sync-library.30112/

The user can easily access these files from any device or computer:

SS-2014-11-17_10.20.03.png


When the user runs the app for the first time they will be asked to grant access to your app. If Dropbox app is installed then the user only needs to click on the button. Otherwise they will need to log-in to their account.

You can see the authorization step in this video:


Using this library

1. You need to register an app with Dropbox that has access to a unique folder:
https://www.dropbox.com/developers/apps
You need to get two values: app key and app secret.

2. If you are using a local mac builder then you need to download the SDK to your Mac computer and copy Dropbox.framework to the Libs folder.

3. The authorization step happens outside of your app. To allow Dropbox app (or the browser) to return back to your app you need to add the following attribute:
B4X:
#UrlScheme: db-ret331arjio70t6
Change the value after db- to your app key.

Application_OpenUrl will be called after the authorization step. You need to call manager.HandleOpenUrl:
B4X:
Private Sub Application_OpenUrl(Url As String, Data As Object) As Boolean
   Log("openurl: " & Url)
   manager.HandleOpenUrl(Url)
   Return True
End Sub

The AccountReady event is raised when the account is ready or when there was a problem with linking the account.
Now you can download or upload files to the account and manage your app specific folder.

When you download a file the DownloadCompleted event is raised when the file is ready. Note that the library always checks that the file is up to date (similar to B4A AutoSync flag).

Sorry @Erel I 've just downloaded dropbox-ios-sdk-1.3.13 and unable to find something like Dropbox.framework in the folder (is that a file, a folder) or do I have to download an older SDK from DropBox...
Thank you for your precious help

Patrick
 
Last edited:

imbault

Well-Known Member
Licensed User
Longtime User
@Erel , sure, if this API is depreciated and on the way to be disabled. So what to you suggest for a cloud storage solution working with both Android & iOS platform (I mean with B4a and B4i libraries) ?

If I stay focused on DropBox, which is a multi-platform very good solution for cloud storage:

After some searches for solutions with DropBox, it seems things can be done with simple HTTP Requests
https://www.b4x.com/android/forum/threads/dropbox-is-deprecating-sync-api.53538/#post-337892

The main problem is authenfication, if I understand, there is a way for Android with @thedesolatesoul B4A library:
https://www.b4x.com/android/forum/threads/library-dropbox-authentication-api-ver-1.19509/#post112412

But is there a way for iOS, for this authentification?

Many Thanks
 
Last edited:

imbault

Well-Known Member
Licensed User
Longtime User
Thanks @Erel , I was on that thread yesterday, I tried it on android, it seems ok, I've to try with iOS.
Thank you very much
 
Top