Core Data - Savings and sharing images via iCloud - ios

I have an app that allows a user to either take photo or point to a photo on from their camera roll. This record must be peristed locally. A record consists of text and an image. Savings this data on a single device seems simple, as I can persist the link to the image or store the image locally in the file system if taken via camera.
Problem is how to share this record via iCloud to make record available to all instances of the app on multiple devices. I.e iPhone creates a record with an image, which is then available to view on iPad or Apple TV.
Is it efficient to store a UIImage in a Core Data record and make this available via iCloud? Many people saying not for local storage
My concern is this could potentially be some large quantities of data?
Does anyone have any thoughts on how to solve this issue?

I´m working on a similar app, for me working with http://Parse.com is a solution.
If your user have an internet connection and can wait to upload the images/text files you can save it directly using Parse (with a fancy progress Bar!) But if you want to make it network-less proof, you might work as whatsapp. I mean using Core Data to save your files locally, then try to upload the imagens whenever there is internet available.
There are some others clouds DB you can use, but I´m familiar with this one.

You can upload to iCloud using NSFileManager.
There is a complete walkthrough on how to do that.

Related

(Swift) Get usage data from other apps through the battery page in settings

I am trying to make an app where it tracks the usage of other apps. I already know that this is impossible to do by directly getting usage data from apps that do not belong to you. I am wondering if there is any way to access the battery page in the settings app by using the code in swift.
All I want is to be able to read the data for hours used and use that data in my app. I know this is probably a stretch, but is there any possible way of doing this?
There is no API to read this data directly.
There is an app on the App Store which has a hacky workaround. It requires users to take a screenshot of the battery usage settings page. The app grabs this photo from the user's photo library and uploads it to their servers where it is processed (using image analysis and OCR). They use this information to estimate how much each app is used.

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 Integration for uploading and downloading files

I want to design an app which stores documents on iCloud. But there are some question which has answer before doing actual implementation.
The question are as follows,
What is maximum file size to upload on iCloud?
Can I programmatically calculate/know the available space on user's
iCloud account?
How can I get the event for uploading and Downloading files from
iCloud?
Can anyone please help me here ? I read the apple documentation but not understood all the things completely.
Thanks In Advance.
Although you mentioned you've read the apple icloud documentation, the designing for icloud documentation page from Apple is still a good starting point for this question.
File Size Limits
The documentation doesn't specify a Document file size limit, nor a Core Data storage limit, other than a user account icloud storage allowance. There is a limit for Key Value storage which is 1Mb for a value (in a value-key pair), which could be an issue for you, but otherwise it seems you can store large files as long as the user has enough space available.
Given the 5gb default amount and accounting for the default user storage needs (photos, contacts, calendars and the like), you may encounter limits for Document and Core Data storage, like any other app. The file management for icloud page mentions good app behaviour:
Apps that take advantage of iCloud storage features should act
responsibly when storing data in there. The space available in each
user’s account is limited and is shared by all apps. In addition,
users can see how much space is consumed by a given app and choose to
delete documents and data associated with your app. For these reasons,
it is in your app’s interest to be responsible about what files you
store.
Check Available Space Programmatically
No
Upload/Download Events
The file uploading and downloading is handled by the OS. All files are stored locally, it's from this local store that you request/modify/save documents. From the icloud fundamentals page:
When you adopt iCloud, the operating system initiates and manages
uploading and downloading of data for the devices attached to an
iCloud account. Your app does not directly communicate with iCloud
servers and, in most cases, does not invoke upload or download of
data.
See this app coda tutorial for an example of key-value store integration, this Tim Roadley tutorial for Core Data store integration or this Ray Wenderlich tutorial for Document store integration.
Edit: The Document-Based App Programming Guide for iOS provides code snippets for moving files to/from iCloud, uploading and downloading as well as monitoring file changes. See "Downloading Document Files from iCloud" and "Moving a Document to iCloud Storage".

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.

Is it possible to sava data in an eBook on iBooks?

I have to develop an eBook for iBooks, and there's a requirement to allow the user to save data, either to local storage to be retrieved when plugged into a computer, or to upload the data to the cloud somewhere, and retrieve from a website.
I know that you can do all sorts on non-book-like things in an eBook, but I can't seem to find anything about whether this kind of data exchange is possible.

Resources