mrshanedaly
mrshanedaly

Reputation: 1

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.

Upvotes: 0

Views: 1353

Answers (3)

Sid Mhatre
Sid Mhatre

Reputation: 3417

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.

Upvotes: 0

Tmm
Tmm

Reputation: 187

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
];

Upvotes: 2

rohit chauhan
rohit chauhan

Reputation: 23

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

Upvotes: 0

Related Questions