Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does NSUserDefaults persist after app transfer?

Tags:

For apps that were transferred between one dev account to another dev account (different teams and thus will have different bundle id prefixes), once an update has been released from the new dev account, do values stored in NSUserDefaults persist or does the whole thing get cleared?

like image 587
royherma Avatar asked Oct 06 '16 02:10

royherma


2 Answers

The answer is actually YES - I tested this with two live apps that were transferred from one itunes connect account to another (with different Team IDs) and that just NSUserDefaults to store and load user data/settings. As I suspected, the reason this does indeed work is because NSUserDefaults do not rely on the bundle identifier's prefix to figure out which container to use.

TLDR:

YES

like image 98
royherma Avatar answered Sep 24 '22 16:09

royherma


The answer is NO and here is the reason.

Data will persist in NSUserDefaults for the entire lifetime of the app,

if you are installing a app with another bundle id [New Bundle ID] so it will count as a another app so that will not hold any old data which is in old app [old bundle ID] .

like image 37
Patrick R Avatar answered Sep 26 '22 16:09

Patrick R