Questions about isExcludedFromBackup option and device migration

Questions about isExcludedFromBackup option and device migration

I posted a similar question a year ago, but I still haven't found a solution that I like, so I'm leaving this question. If anyone knows how, please let me know.

In our app, we set the isExcludedFromBackup option to true so that files currently in the Documents path are not backed up to iCloud.

In the current situation, I am just curious as to whether the files of our app can be backed up in the two situations below. (with isExcludedFromBackup option set to true )

  1. Migrate iPhone to new iPhone
  2. Backup and restore the entire device to iTunes

If you set the isExcludedFromBackup option to true in the file, iCloud backup will not be possible, and the app's internal files will not be copied even in the two situations mentioned above.

Is there an option or method in the app's internal code to prevent automatic backup only to iCloud and allow files to be copied or synchronized in the above two situations?

I have a settings switch, and advise users to turn it on if they do backups over USB to a computer, and turn it off if they do backups to iCloud. By default it is off.

My guess is that only a small fraction of users even discover that the switch exists. It is not a good solution. But there isn't a better one.

Are you saying that the user should be able to turn the isExcludedFromBackup option on/off?

Yes, indirectly; when the app starts it reads this setting from NDUserDefaults and updates the xattr to reflect it.

have you ever been rejected or encountered any problems during app review?

Frequently, but not related to this; I doubt think they’ve ever noticed the feature.

Questions about isExcludedFromBackup option and device migration
 
 
Q