mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
323 stars 8 forks source link

RMTileCache in Documents #641

Open trdavidson opened 9 years ago

trdavidson commented 9 years ago

When using the offline-maps example, the RMTileCache of the Map appears in the Documents folder. This will immediately cause a rejection in the App Store. We are getting ready to ship our App for production and wanted to ask how to change this behaviour for RMTileCache. Thanks!

username0x0a commented 9 years ago

I've been dealing with this as well in our project. You can temporarily disable iCloud sync:

[[NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]]
    setResourceValue:[NSNumber numberWithBool:YES]
        forKey:NSURLIsExcludedFromBackupKey error:nil];

for the whole Documents folder or for a specific path by modifying the code above; your app will stop syncing the provided path and should become review-compliant. Otherwise you can customize this path in Mapbox component source. AFAIK there's no programatic way to change this at this moment.

jcarbaugh commented 9 years ago

I haven't tried this myself, but you should be able change the cache path from Documents to Caches with routeme.plist. See the example plist on the SDK page under "File-based cache configuration" where useCachesDirectory gets set to true.