3lvis / DATAStack

100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer
Other
214 stars 44 forks source link

iCloud backup issue #113

Closed kaszap82 closed 5 years ago

kaszap82 commented 6 years ago

First of all sorry for my bad Engish.

I have a project with DATAStack. A lot of users have a problem, when they set a new iPhone from iCloud backup. The data strored in CoreData doesn't exists on the new phone. Should I have to set something to "tell" Apple, that they should backup the sql file? Did you hear about similar issues?

Thanks for your help!

3lvis commented 6 years ago

Hi @kaszap82,

This was a conscious choice, I experienced many rejections based on Apple telling us that I shouldn't be backing up sqlite, so I set a flag so this doesn't happen.

https://github.com/3lvis/DATAStack/blob/master/Source/DATAStack.swift#L449-L456

screen shot 2018-04-15 at 7 26 19 am

https://developer.apple.com/library/content/technotes/tn2350/_index.html

3lvis commented 6 years ago

This was some time ago, I believe there's approved alternatives by Apple to backup your data, if you find something I'll be glad to include it in the library :)

sverin commented 5 years ago

Isn't this only true for Default Data Stores, shipped with the app? It should not be applied to user data stores. If our users buy a new iPhone or iPad and restore from a iCloud backup they would expect that the data for our app was restored as well.

At least, could it be an option when we initialize the data stack so that we could decide by our self if the flag should or shouldn't be used.

3lvis commented 5 years ago

That's a good point, it can be made optional. Any chance you could look into it? ๐Ÿ™

sverin commented 5 years ago

Sure, I can look into it. Donโ€™t know how much time I have before the holidays but I will do it as soon as I can.

sverin commented 5 years ago

@3lvis Should it be excluded or included in the backup by default? I would say it should be included in the backup. So that you have to specify if you have a default store that should be excluded.

sverin commented 5 years ago

@3lvis Any change you could have a look at the pull request?

3lvis commented 5 years ago

Merged!

3lvis commented 5 years ago

Let me know if it works as expected, I made it excluded by default to not break existing functionality.

Thanks for your contribution ๐ŸŽ‰