I'm in the learning stages of IOS development and have a few questions based on some behavior I recognized on my initial testing.
My questions for now will be related to a local ITunes backup.
For one thing, does an app that is not "certified" (an app under development and testing) supposed to get backed up on ITunes? On ICloud? And what about it's core data? I ask this because I watched as it backed up other apps, but not my test app in the progress bar.
Bottom line is, I want to test how a user of my app's [core] data will or will not be restored under 2 situations as follows.
The user drops his phone in a lake and needs to do a COMPLETE RESTORE on a new device
The user deletes my app (after having backed up), then later wants to reinstall the app.
Through a few different iterations, I can not get my app's data back after an app removal and reinstall.
I would like to test this under both local and ICloud backup. From what I can understand, you are not given the option to see what files/apps are backed up and available to restore. Furthermore you are not able to restore individual apps/data? Or am I missing something?
I have not done anything special in terms of "designing for ICloud backup/restore or syncing". I want all data to be available ONLY locally as it is and is currently working great.
I guess my biggest question for the moment is "Are development apps treated like certified apps in the backup and restore processes?"
There is a lot of information out there but it is all rather convoluted. Plus it appears an ICloud backup/restore and an Itunes backup/restore are 2 different animals? Thanks for any guidance.
BTW, I can see the app in the Backup Options, and Backup? is set to yes, however after I backup and look on ITunes, I see all the other apps except my test app.
Related
What technology is available for me to save app data (Core Data) so that when a user switched phones and has a fresh phone they still have my app information?
I have heard people say cloudKit, however that seems overkill, I don't want the functionality to handoff between devices. I simply want the app data to be backed up when the user has iCloud backup enabled for the app.
If the answer is iCloud, what steps must I follow to enable such behavior? I have seen links to cloudKit tutorials, however all of them cover an extensive amount of material and work, and what I want to achieve seems simple enough. (As stated before I do not want handoff between devices, I have no need for it.).
Thank you for the suggestions
Edit: I have gone into "capabilities" and switched on iCloud. Now in my iPhone settings under iCloud backup my app appears. However does simply switching on iCloud capabilities persist your app data to iCloud Drive or backup?
Ex: Go to Settings -> Account -> iCloud -> Scroll down to iCloud Drive and ensure it is checked. My app shows there, but I haven't included any code to implement this (I simply flipped the switch in capabilities)
So from my current understanding I create Core Data as normal, however I add a listener for an changes/updates/deletes/creation of the persistentStore and upload/update iCloud via document storage when this happens? I was under the impression that iCloud was being depreciated and that only cloudKit will remain?
Edit 3:
iCloud = Depreciated, therefore the one and only solution available is cloudKit.
How does one implement cloudKit to interact correctly with Core Data?
What comes to mind is the following:
- Enable cloudKit
Listen to all changes to persistent Store and reflect these changes in CloudKit (somehow)
On app start check to see if CloudKit matches core data (somehow)
if they are not the same then download cloudKit data and save to core data (somehow)
Please clarify if this is not the correct route to proceed down
What technology is available for me to save app data (Core Data) so that when a user switched phones and has a fresh phone they still have my app information?
There isn't any such problem. I've upgraded devices many times and nothing has ever been lost. When I got a new iPhone last year, and when I got a new iPad this year, all my apps on the new device simply showed up with the same settings and data as before on the old device.
That's the because the user who gets a new device backs up from the old device and restores to the new device. That's what I always do and it just works. You cannot reliably work around a user who is too stupid to know to do that, so I recommend not even thinking about it.
I have an iPhone app that now needs to be removed. I can do this by following the steps in iTunes connect:
Untick all territories in pricing and availability
Then in Additional Information : Delete App
I have completed step 1 and am about to follow step 2 but I have a question that I cannot find answered on any of their help/docs nor online elsewhere. Once I delete the app - it will get removed from the app store, but will it still stay on all users iPhones that have already got the app downloaded and installed on their phone? Or will it automatically be deleted/removed from all phones?
Ideally I need to remove the app completely so that it can no longer be used be new or existing users even if they already have it on their phone.
It will stay on the user's phones.
In your case even worse for you: If they backed up/synchronized the application LOCALLY via iTunes, they got a local .ipa-file (an instance of your app), which they could even restore, after they setup the device once again.
For the users this is a pretty convenient way. So, if you want to delete your application. Inform users about that step and if you have a good exit strategy, users will adopt this and will delete it on their own.
The app will stay on the users IPhones. There is no way to remove it remotely.
The only thing you could do would be to release new version with a lock but then you will probably get trouble with Apple.
I have a development distribution of an app out on a couple of devices.
Turns out my export functionality causes a memory leak - meaning I can't get that screen to open without reinstalling the distribution of the app.
Is that data totally lost? I'd really like to be able to save it.
Some ideas:
Write a second helper app that could grab the data
Write some sort of shell script that could retrieve the data plugged into a comptuer
Plug in the devices to a computer... do something in Xcode... no lost data?
Is there any hope?
UPDATE
There was hope!
First - Your data is accessible via Organizer in XCode.
Second - New versions in iTunes do not overwrite core data. BUT you're going to want to make sure the version # increases as iTunes was somewhat finicky about sending over the new version. Your testers might be tempted to delete the app - replacing it in iTunes and re-syncing is all they need to do.
If you update the app without deleting it first, the data is not removed by the OS. So the new version of your app has the opportunity to read the old data.
I have an app that saves user entered information to the NSDocumentDirectory. On issue that people are having is when they upgrade their iPhone to iPhone 5, the information in their old NSDocumentsDirectory are not being transferred over, even when they select the app to be transferred over.
Users end up loosing all their entered data when they upgrade.
When users upgrade the app on the same phone they do not lose their data. It only happens when they upgrade to a new iPhone.
What is the way to correctly save User data and make sure it is transferred over when the phone is upgraded?
Data is only transferred to a new device if they choose to do a full backup of the old device and then choose to restore that full backup to their new device. Simply transferring apps results in fresh installs of the apps with no data.
This has always been a major problem with iTunes (and now iCloud backups). There is no way to backup a single app and its data and there is no way to restore a single app and its data. Only the app can be restored but no data unless a full device restore is done.
All of my apps have their own built-in features for backing up and restoring its own data. This allows users to easily transfer data between devices or deal with them messing up their own data by mistake.
I have an app on the app store, that uses coredata as storage. I wan't to update the app with iCloud synchronization as new feature. Following apple`s sample code, I managed to have my core data storage synchronize between devices.
However, I'm experiencing problems when either iCloud synchronization is turned off/on in the app on only one of the devices, or when the app is deleted from the device and the reinstalled. In both cases, data is not synchronized back to the device, although it is available just fine on a second device (which was not disabled/reinstalled).
I also found that all storage is effectively erased completely, when I delete the app from all devices, and then reinstall. Althrough I get a couple of merge notifications in the console (even some without errors), I can't see no data in the local storage of the device.
Browsing the mobile documents folders on my mac still reveals lots of transaction logs in the icloud storage of my app.
Even deleting the app from all devices and starting from scratch wont sort things out. I will end up in a situation where data is either only synced to one device, or not synced at all.
I wonder if there is anything I can do about this inconsistent state that is created when only one device is temporarily iCloud disabled, or the app is deleted from ONE device?
As for my code, its an 1:1 copy of the recipces example from apple.
Daniel Pasco talked about using Core Data and iCloud together at NSConference 2012. Some notes from that blog post:
launching with -com.apple.coredata.ubiquity.logLevel 3 to get a spamfest in the message log saying what Core Data and iCloud are doing.
The conclusion from this talk appears to be that using Core Data and iCloud are really not ready for each other at this stage.
He posted an updated Core Data Recipes project on Github which may or may not fix your problem.
Apple makes it seem easy, but there are a number of nuances with regard to correctly seeding iCloud with data, and what happens afterwards when iCloud support is toggled on and off on different devices.
I implemented a sample project that demonstrates a straightforward way to add iCloud support to Library-style CoreData apps. It's called iCloudStoreManager and it's available on github.
I'm still testing it before I add iCloud support to one of my own production apps. It's working, but I see unexpected errors and delays when an iPad 3 is in the mix. It works, but with long delays.
I've also tested with iPhone 4, iPhone 4S, and the original iPad, and any mix of those devices works well in my experience.