How iOS prevent app from stealing files saved in google drive? - ios

Apple's Files app treats google drive as a folder and operates files saved in google drive in the same ways as local files saved on the phone. See "Use the Files app on your iPhone, iPad, and iPod touch".
It is convenient, e.g., if want to send a file saved in google drive to a friend via iMessage, just browse into the google drive, select file and send. I sent files via another applications also.
Now the question comes: what if an app on the phone wants to steal files saved in my google drive?
I think this concern is common, as I trust google drive before because it has two-steps verification, I save some personal files in google drive. But now if I install google drive on my iphone, together with some other social communicators, it looks like the files in google drive can be easily get accessed by them. I don't feel safe anymore. There is a lot of discussion.
How does iOS prevent bad app from stealing files saved in google drive, or DropBox?

Apps cannot simply access Google Drive. They must do so through a UIDocumentPickerViewController which requires user interaction

Related

Is there a way to tell the location of a URL (On My iPhone, iCloud Drive, Google Drive, etc.) when importing with UIDocumentPickerViewController?

I'd like to be able tell if the URL's returned from UIDocumentPickerViewController were from "On My iPhone" or one of the cloud services. Which cloud service is not important, just whether it's a local or cloud file.
I know there's FileManager.isUbiquitousItem but this only works for iCloud Drive, for Google Drive or DropBox files it will return false. Any ideas?

Can you get a song onto your iPhone thru your app?

I would like to get songs from my computer to my iPhone inside of my own app. This would be a music playing app that would have the ability to load songs into its own directory from some private source like a laptop or cloud storage.
Example: If I have 100 songs on a Google Drive and I write an iOS app that loads those files from the Google Drive into the apps directory.
iOS, iPhone, Swift.
Yes you can download files into your app's Documents directory, which will be private to your app.
Here's a SO question on downloading a file in Swift/iOS that shows some concrete code examples: How to download file in swift?
You can also find many tutorials online on saving files and making HTTP requests in Swift.
You'll need to determine specifically how to make requests to your file provider e.g. Google Drive. This might involve not only the URL itself but also authentication, SSL validation etc. which are deeper topics in themselves but fully supported in Swift/iOS.
Yes, you can definitely download songs to your phone from your computer. You just have to make a directory area in your app and have the song be fetched into that directory.

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.

Does iOS' 8 iCloud Drive enable different users to share files?

C.f. Apple website page on iCloud Drive:
http://www.apple.com/ios/ios8/icloud-drive/
I understand iCloud Drive makes easy for an individual user to save a file to the cloud and work on it from any of his or her own devices, i.e. a solo use case.
My question is: with the new iCloud Drive, can different users, with different Apple accounts (not necessarily in the same family), share and collaborate on files? E.g. Could an iOS 8 app help a bunch of users collaborate on, say, a video editing project where all the heavy raw footage video files are shared on iCloud Drive?
CloudKit is for backend app usage for developers. It has nothing to do with iCloud Drive user accounts. Time will tell how sharing works with iCloud Drive.
Answering my own question: yes, it is possible thanks to CloudKit, c.f.
https://developer.apple.com/icloud/documentation/cloudkit-storage/

How can 3rd party app "A" let novice iOS device users open an MP3 file downloaded by 3rd party app "B"?

My goal is to make an iOS app that includes the ability for the user to open MP3 files that were downloaded (by the same user) within a different 3rd party app, similar to the functionality of a ringtone maker that relies on opening files that the user has already downloaded. If I understand correctly, this is easy to do if the "other" app is Apple's native iPod music player app, via the "iPod Library Access" interface. Hopefully I have at least that part right.
But what if the "other" app is a non-Apple 3rd party app, through which the user downloaded the MP3 file that we now want that user to be able to open within our app? From a high level (I'm not asking for code), how is this done? And has your analysis changed based on what was announced for iOS 7?
For this to be possible, the third-party app in question must expose some mechanism for doing this. They might implement hooks through the sharing charm, or they might expose a "documents" repository from which other applications can read (optionally, with granted permissions from the user to do so). For example, the AirShare application can read your Dropbox files. This is because Dropbox has exposed the files as a documents repository and the user has granted permission for AirShare to access Dropbox. If the third-party app doesn't implement these hooks, there is no way to access the documents from another application.
Edit:
To access the music files in the user's iTunes library, I'll refer you to the iPod Library Access Programming Guide at http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/iPodLibraryAccess_Guide/Introduction/Introduction.html

Resources