Offline sync with Dropbox API v2 - ios

With the Dropbox Sync API there was a method [DBFile writeContentsOfFile] which would sync the file at a later time if the internet connection was offline.
Is there a similar function in the new Dropbox API v2?
I've found a method on DBFilesRoutes -uploadData:inputData:, which works fine for normal upload, but fails with an error if there's no internet connection...and unfortunately it doesn't sync later when the connection is restored.
Perhaps using DBFilesRoutes -uploadSessionStartData: is the solution (which I'll attempt shortly).

No, unfortunately the official Dropbox API v2 SDKs don't offer offline support like that. We'll consider it a feature request.
The difference between uploadData and uploadSessionStartData is that uploadData is for uploading files in one call, whereas uploadSessionStartData is used along with uploadSessionAppendV2Data and uploadSessionFinishData to upload larger files in multiple pieces.

Related

Stream audio file from Google Cloud Storage to iOS Firebase client app

I'm using Firebase with an iOS client app, and I need to stream an audio file from Google Cloud Storage. I know file streaming support exists in the Android SDK with the class: StreamDownloadTask, but I cannot find an equivalent in the iOS SDK.
Best scenario would be able to achieve this without intermediary server functions, so directly between the iOS client and GCS. Is this possible?
If not, I have a Node.js server that I can use. Should I use the createReadStream GCS API function and pipe that to the client? Or is there a better way?
Any advice on the optimal way to create a stream from a GCS audio file to an iOS app would be hugely appreciated!
Firebase employee here
There is not, in fact, any Cloud Storage streaming API for iOS in the same way that there is for Android. If this is important to you, please file a feature request and explain why it's important for your particular case.

Cloud-based automatic new youtube upload download to dropbox

Basically what I'm trying to achieve is:
-whenever a new video is posted on my channel, trigger a zap/ifttt to download it to dropbox in mp4 for backup purpose, added bonus - extract audio to mp3.
I want to do it automatically and on a free remote service, not my PC or VPS. I know it all this could easily be done locally, but I want an independent solution for a number of reasons.
The problem is, youtube api prohibits video download.
So far I have investigated web-based downloaders, but couldn't figure a way to automatically get a download link without visiting the website. cloudconvert doesn't support direct youtube download.
The closest thing I found is a web-fork of youtube-dl that allows it to run on owncloud, but I'm failing to find a free owncloud provider that allows user apps.
There should not be more than 3 short channel uploads a day, so performance and delays are not much of an issue, I'm happy to wait up to a day for the download to commence.
Any help much appreciated.
One step of the process is probably using offcloud, which can fetch your youtube video and store it on a cloud storage, such as google drive, ftp, etc. It has API

when implementing Dropbox API on iOS app

I just started implementing Dropbox API on my iOS app.
Last time, when I played around with iCloud a bit, I found that Apple recommended an app save the data either locally or on iCloud, not on both.
I remember the code for data transition when user switching the setting between local and iCloud was a bit difficult.
Does this apply to Dropbox, too?
So, when the user chose Dropbox option, should I save all data through Dropbox API exclusively?
or could I save one copy through Dropbox and another through native iOS code?
Thanks for your help in advance!
Which API?
For both files (Sync API) and datastores (Datastore API), the iOS SDK will cache data locally on the device as well as store it in the cloud, so there's really nothing to do aside from use the SDK.

Best practice to sync webservice with offline storage on iOS

I have been working on a few iOS applications that talk to a REST API on the web server and than sync some data down for offline usage. The app then stores data locally if network connection is not available and than syncs with backend whenever the Internet connection is available.
I am wondering if there is a nice pattern or set of rules or library that can be used. I would rather not code this again and again. I know the business logic / sync logic would be different for each app but the rest of the work (ie. storing it locally, calling REST API) can be abstracted out.
Any ideas?
I use the RestKit framework in my app for the exact scenario you describe. The downloaded data are stored in a Core Data store for offline usage.

Resumable uploads in Objective-C

A part of my iOS app is to perform uploads of large files to a server. Internet connection of my users is not always ideal.
Is there any way I can perform resumable uploads?
P.S. Request type is HTTP, but if it doesn't support it, it's possible to switch.
check this out:
https://developers.google.com/youtube/2.0/developers_guide_protocol_resumable_uploads

Resources