When does tvOS purge user data - core-data

Does anyone know what events will cause tvOS to purge temp user data on Apple TV? I'm assuming that it will be things like when it needs space to cache movies and other iTunes content. Does this also apply for streaming offline content (i.e. streaming things from local servers in a non-internet connected environment)?
I have a client who wants an Apple TV version of their app. Data is currently stored using CoreData. I will be using CloudKit to sync that data with iCloud. However, the problem is that my client may not have the Apple TV connected to the internet at all times. My concern is if they make a bunch of entries (small data, on the order of a few MBs, max) while the unit is offline. If they never connect the unit to the internet so it can sync with iCloud, is it still possible that OS will purge that use data?
If it still may be purged, what are other options? I know we only get 500kb of NSUserDefaults storage, which is not going to be enough space for my needs.
My assumption is that if the Apple TV is not connect to the internet and not downloading and streaming content from iTunes, the OS will not have a need to purge anything and the user data should be safe.
Can anyone comment on this, or point to some documentation in some magical hidden location on the Apple Developer portal?

Related

Should I use a different class/method/pattern to handle local-cloud syncing of data?

I'm new to Azure Mobile Services as well as mobile development.
From my experience in web development, retrieving data from the database is done part by part as the user requests more data i.e. the website doesn't load all the data on one go.
I'm implementing this principle in mobile app wherein data is loaded (if already in the local db) or downloaded (if not yet in the local db) as the user scrolls down.
I'm using Azure Mobile Services Sync Table to handle the loading of data in the app. However, i wont be able to paginate the downloading of data. According to this post, the PullAsync method downloads all data that has changed/added since its last sync and doesn't allow for using take/skip methods. This is because PullAsync uses incremental sync.
This would mean there will be a large download of data during the first ever launch of the app or if the app hasn't been online for a while even if the user hasn't requested for the said data (i.e. scrolled to it).
Is this a good way for handling data in mobile apps? I like using SyncTable cos it handles quite a lot of important data upload/download stuff e.g. data upload queuing, download/upload of data changes. I'm just concerned with downloading data that the user doesn't need yet.
Or maybe there's something i can do to limit the items PullAsync downloads? (aside from deleted = false and UserId = current user's UserId)
Currently, i limited the times PullAsync is called to the Loading Screen after the user logs in and when the user pulls to refresh.
Mobile development is very different from web development. While loading lots of data to a stateless web page is a bad thing, loading the same data to a mobile app might actually be a good thing. It can help app performance and usability.
The main purpose of using something like the offline data storage is for occasionally disconnected scenarios. There are always architectural tradeoffs that have to be considered. "How much is too much" is one of those tradeoffs. How many roundtrips to the server is too much? How much data transfer is too much? Can you find the right balance of the data that you pass to the mobile device? Mobile applications that are "chatty" with the servers can become unusable when the carrier signal is lost.
In your question, you suggest "maybe there's something i can do to limit the items PullAsync downloads". In order to avoid the large download, it may make sense for you to design your application to allow the user to set criteria for download. If UserId doesn't make sense, maybe a Service Date or a number of days forward or back in the schedule. Finding the right "partition" of data to load to the device will be a key consideration for usability of your app...both online and offline.
There is no one right answer for your solution. However, key considerations should be bandwidth, data plan limits, carrier coverage and user experience both connected and disconnected. Remember...your mobile app is "stateful" and you aren't limited to round-trips to the server for data. This means you have a bit of latitude to do things you wouldn't on a web page.

Share UILocalnotification between devices

I'm developing an ToDo app, and I'm planning to use UILocalNotification. I have integrated CoreData with iCloud support.
I have searched a lot on Google how to share the notifications between the devices, but I can't find anything.
So i hope some of you people out there can help a new Swift developere here, so my question is:
1: Can i share notifications between devices without using a server to send push notifications?
2: How many NSLocalnotification can i have on a device?
//Kim
If you are using Core Data with iCloud to keep the data in sync between devices you can somewhat achieve what your after. What you would need to do is detect when new changes are imported from iCloud and refresh the notifications at that point. I have used that approach successfully before but it does come with a few caveats. In particular:
- Without storing additional information the same notification will be shown on multiple devices.
- The synchronising of the notifications is reliant on the iCloud data being updated. This means that without a means to refresh the iCloud data in the background other devices will not be in sync. It may be possible to work around this using an extension or background services but I'm not too familiar with them.

How does DRM video Streaming happens under the hood?

I need to develop a system to stream media over the web to subscribers (like Netflix). It's very important that my consumers can't "save on disk" my videos, since I'll be billing them by the minute watched...
I would like to know how video-streaming-DRM software, like the one behind Netflix, actually work. How the encryption happens? Do they use symmetric keys? I don't need specifics about the implementation, not now at least, but rather a overview of the whole system (client and server)
Extra Info:
-I will be the one uploading videos. The user wont upload videos
-I intend to build this as a Azure Cloud Native App
-I have not yet decided on the client side yet. Since my target public is quite narrow, I'm considering if I should build a app client or web-client... in case of web I would like to leverage the new DRM capabilities ...
-The server side will be C#
-It's safe to assume that the end-user will have a "decent 3ยบ world" internet connection (at least 1 Mb/s)
Although quite reasonable, your question does not really fit the Stack Overflow's format. But I'll give you some hints and resources to check out:
Microsoft PlayReady Overview - check it and related pages (like Learn More, White Paper)
EZDRM
Content Protection with Windows Azure Media Services
Task Preset for Windows Azure Media Encryptor
Clients of DRM protected content can be developed in Silverlgiht, Windows Store App, iOS native app (this one is not open to the wide public!). Never tried Android and HTML 5.
In short - don't worry! If you use a DRM solution, your users will not be able to save the videos. However, one can always do a screen capture using [Expression Encoder Screen Capture | Camtasia Studio | Any screen capturing software]. So there is no full 100% content protection.

iCloud with Core Data

this question was asked a year ago, but I have a specific question about online/offline syncing.
Device A & B are both offline, and you make independent changes to the model, lets say you connect device A first, so those changes sync to the cloud.
Now you connect device B, now those changes need to be merged with the changes existing on the cloud (not simply replace the cloud, because they have changes as well)
Does iCloud take care of this?
That's the idea, Core Data works with iCloud and merges any changes, resolving conflicts by choosing a winner. You don't get to help choose the winner, but you get notified if/when any new changes are available to your app.

IIS Smooth Streaming encoding with Azure?

I'm working on a project for teachers and students to be able to have a medium to interact with one another using Azure as a medium for content delivery. However, since this is basically a free service (and a non-profit site), not every teacher can buy a copy of Encoder Pro to encode their streams.
This is where I'm at a crossroads and not sure what path to go down. I want teachers to be able to stream their desktops and interact with students, probably using the MSN chat services or facebook chat services since it's infrastructure that I don't need to pay for. However, additionally the question is how do they capture their desktop? And would Azure be able to convert that into a "smooth streaming" file, so that people with lower bandwith connections can see the stream reliabily? I know Azure can function as a CDN, but I'm not sure if it can do the conversion to live smooth streaming so that students can actually make use of the service.
Any ideas would be helpful.. I'm kind of brainstorming right now and working on the client end of things, but I've slowed down until I can figure out this problem.
Thanks!
To answer part of your question, Azure recently added a Media Services component. It's still in preview mode (free for now). Think of it as a hosted Expression Encoder Pro exposed with a bunch of APIs. For more info https://www.windowsazure.com/en-us/develop/net/how-to-guides/media-services/

Resources