You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
On first app run, cache.db is backed up to iCloud #5577
When you first open the app, there is no cache.db to begin with. setResourceValue:forKey:NSURLIsExcludedFromBackupKey is getting called on the file, but you have no guarrantees that the file is created at that point and the call won't fail silently.
So, on the first run, NSURLIsExcludedFromBackupKey might be set before cache.db is created, hence being left with cache.db being backed up by iCloud, automatically rejecting your app when reviewed on the App Store.
A simple and effective solution (that I employed in my app) is to set NSURLIsExcludedFromBackupKey on the cache directory, which is ensured to exist, instead of on the file.
I'll submit a PR in a sec.
Platform: iOS Mapbox SDK version: 3.2.0
Steps to trigger behavior
Use offline maps in your app
Download a big enough offline pack in the first run of the app
Publish the app to the App Store
Expected behavior
Though big in size, cache.db will be marked with NSURLIsExcludedFromBackupKey, so it will not be backed up. Hence, your app will pass the review process with flying colors.
Actual behavior
Your app will get rejected because cache.db is not properly excluded and you'd end up saving hundreds of MB on the user's iCloud account.
Activity
[ios] Set backup exclusion attribute on cache directory.
dapetcu21 commentedon Jul 5, 2016
If you want to try to reproduce, I suggest using
to test if the
com.apple.metadata:com_apple_backup_excludeItemextended attribute is there.friedbunny commentedon Jul 6, 2016
Thanks again for reporting this and proposing #5578, @dapetcu21.