How to make a resumable upload with Google Drive iOS SDK - ios

I am able to upload a file with google drive iOS sdk now.
Basically using "GTLService executeQuery".
I get this from the Google Drive iOS sample
But it is not a resumable upload. If the network fail when I upload a big file, the upload will start again from the beginning.
I know how to make a resumable upload with this method
But can I make a resumable upload with google drive iOS sdk?
It seems that I can only make it happen with NSURLConnection.

Related

Can I upload files to google drive from iOS Application?

I'm creating an application that collects data from a bluetooth peripheral. When all of the data is collected I want to upload my data, which is in the format of a .txtfile, to a google drive account for processing.
I have looked at this method and it doesn't really seem to fit the purpose
https://developers.google.com/drive/v3/web/quickstart/ios?ver=objc
Is there anyway way I can do this in Objective-C? I have searched everywhere and I cannot seem to find something.
An easy way is to leverage the CloudRail SDK for Google Drive. Here is how you would upload a file:
CRGoogleDrive * service = [[CRGoogleDrive alloc] initWithClientIdentifier:#"[Google Drive Client Identifier]"
clientSecret:#"[Google Drive Client Secret]"
redirectUri:#"http://localhost:12345/auth"
state:#"someState"
];
[service uploadFileToPath:#"/myFolder/myFile.png"
stream:readableStream
size:1024
overwrite:true
];
Yes, You can upload a text file to google drive. Please look up to this post.
IOS: How to upload a file to specific Google drive folder using Google drive sdk library
You can upload .txt and other type of file on google drive. You can go through from this tutorial Google Drive Integration in iOS apps and
Uploading a file to Google drive using iOS sdk
Or
Refer Introduction to the Google APIs Client Library for Objective-C for RESTfor detail explanation.

Offline sync with Dropbox API v2

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.

How can I choose PDF file from my phone library for attachment in iOS app?

I am using image picker to upload image from camera roll. Can I do same for PDF or any other doc format? If no, then what would be the alternative method to use PDF as an attachment?
I also tried to do the same but failed.
At last I integrated Dropbox with my app and then uploaded the PDF and Doc files. Dropbox integration would be an easy and handy option.
Here is the link for Dropbox
https://www.dropbox.com/developers-v1/core/sdks/ios
Google drive is also an alternate that you can use to upload the documents but it is hard to integrate.
Here is the link for Google Drive
https://developers.google.com/drive/ios/quickstart
Hope it saves your time!
All the best

How to increase the upload file size when uploading file to google drive through your app?

I have integrated google drive to my iOS , desktop(window) and web application using google drive api . when i upload pics or video less than 4Mb , it uploads to my default drive folder, but when i try to upload more than that it gives me exception. what is the best solution for that?

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.

Resources