when implementing Dropbox API on iOS app - ios

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.

Related

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.

How to get the saved text file from my iOS App to PC?

I build an iOS App that collects data via BLE and saves it as text files. What I want to do now is to retrieve the saved data on my PC (Windows) for further analysis. As the developer I know I can download the App container via Xcode for accessing the saved file and it works well. However, I wonder if there’s any approach that I can get the saved files without using Xcode? Can I save the text files to a public location so I can access them directly?
In short, you can't do what you want in this exact way, as iOS devices do not support the USB mass storage protocol. The only way to get files out is using iTunes, which can access your iOS device's Documents folder.
Of course, you could reverse-engineer that protocol, but that's a bit unreliable and might break if Apple ever changes something.
Instead, find another way. E.g. you could have your PC app contain a tiny HTTP server and have your iOS app send an HTTP request to it that contains the file's data. Alternately you could even go via an actual server on the internet.
Or, given all iOS users have iCloud, you could also just save your data to iCloud, then have your PC users install Apple's iCloud for Windows stuff and then just access the file from there.
If I understand you correctly, you want to access the client's data on the PC.
You can create a file server or use a third party service like Amazon S3(https://aws.amazon.com/s3/).
Client upload that collects data through the http/https protocol.
PC download the client's data and analysis.

Uploading image to Azure and getting back its URL

I am writing an iOS app for a service that runs on Azure. I need to be able to upload images (users' profile pictures) and get back the image's URL.
Azure's SDK for iOS doesn't seem to work with Blob, but only with Tables.
On my search, I've found tutorials like this, which gives an intro on the SDK, or this one that shows how to store a base64 string of the image in a table, but that's not what I'm seeking.
Is it possible to upload images to the Blob? If yes, how?
I am not an ios person, but have worked on apps that run on azure and communicate with ios for information hence this might be of your help as I am certain rest services can be accessed from ios.
http://msdn.microsoft.com/en-us/library/azure/dd135733.aspx

iCloud for web application

Has Apple provided public API for web applications?
I want to build an application which will be similar to dropbox.
I want the user to be able to manage files and edit them from their devices (iphone/ipad/mac) and from website (any browser based) too.
Is this possible now to see the list of files using iCloud API?
Thanks.
As I just stumbled across this thread while searching for a solution for iCloud contacts in my web-app, I just wanted to add that nowadays CloudKit JS seems promising for this use case. It's a bit unfortunate it needs an app on its side, but it's still better than nothing :)
Can I use iCloud API in web application?
No, Apple only provides APIs that can be used within native apps on iOS or OS X devices. There's no documented API that could be used for a browser-based interface to a user's iCloud account (some API apparently exists, since Apple uses it, but third parties do not have access).

How can I use Dropbox API to access files hosted on my own computer?

I have a question about the Dropbox API. I may or may not be going about this the right way, but I would like to develop a simple app for iOS that allows me to use the clean Dropbox interface to access files on my computer, not ones hosted on Dropbox servers. I'd like to be able to stream music from my computer straight to my device, without worrying about storing the files in the Dropbox cloud. (I have about 120 GB of music) Is the Dropbox API the right approach? How should I get started? Thanks for any advice - I don't expect a complete solution, just ideas so I can get started on the work myself.
Thank you!

Resources