IOS App Store and application data storage locations
-
When I submit an app to the Apple App Store, I don't want to get delayed by storing or saving user data or configurations files in the wrong location. What locations have others used in their submissions?
Specifically, which enum for QStandardPaths::StandardLocations( enum ) would apply to the following Apple specified directories..
<Application_Home>/Documents
Probably: QStandardPaths::DocumentsLocation
Could also be: QStandardPaths::DataLocation
And could be: QStandardPaths::GenericDataLocation<Application_Home>/Library/Caches
Could be one of the following (or the QStandardPaths::DocumentsLocation option depending on how you read the Apple directive below):
QStandardPaths::CacheLocation <--the returned path is never empty.
QStandardPaths::GenericCacheLocation <--the returned path may be empty if the system has no concept of shared cacheFrom the Apple website for app data storage guidelines..
https://developer.apple.com/icloud/documentation/data-storage/index.htmlOnly documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud.
Data that can be downloaded again or regenerated should be stored in the <Application_Home>/Library/Caches directory. Examples of files you should put in the Caches directory include database cache files and downloadable content, such as that used by magazine, newspaper, and map applications.
@// what target platform ?
qDebug() << "Main.cpp: platformName():" << QGuiApplication::platformName();// paths that could be used to read or write user records and app startup-restore configuration
// the documents directory..always available per qt docs..no test for ifexists needed ??
QString docsPath = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0];
qDebug() << "Main.cpp::main reading standardpath::DocumentsLocation: " << docsPath ;// the data directory..not specified if always available per qt docs..test for ifexists needed ??
QString dataPath = QStandardPaths::standardLocations(QStandardPaths::DataLocation)[0];
qDebug() << "Main.cpp::main reading standardpath::DataLocation: " << dataPath ;// the generic data directory..always available per qt docs..no test for ifexists needed ??
QString genericdataPath = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)[0];
qDebug() << "Main.cpp::main reading standardpath::GenericDataLocation: " << genericdataPath ;// the cache directory..always available per qt docs..no test for ifexists needed ??
QString cachePath = QStandardPaths::standardLocations(QStandardPaths::CacheLocation)[0];
qDebug() << "Main.cpp::main reading standardpath::CacheLocation: " << cachePath ;// the generic cache directory..always available per qt docs..no test for ifexists needed ??
QString genericcachePath = QStandardPaths::standardLocations(QStandardPaths::GenericCacheLocation)[0];
qDebug() << "Main.cpp::main reading standardpath::GenericCacheLocation: " << genericcachePath ;@// output from the Mac dev desktop app
Main.cpp: platformName(): "cocoa"
Main.cpp::main reading standardpath::DocumentsLocation: "/Users/PSI/Documents"
Main.cpp::main reading standardpath::DataLocation: "/Users/PSI/Library/Application Support/qMarks"
Main.cpp::main reading standardpath::GenericDataLocation: "/Users/PSI/Library/Application Support"
Main.cpp::main reading standardpath::CacheLocation: "/Users/PSI/Library/Caches/qMarks"
Main.cpp::main reading standardpath::GenericCacheLocation: "/Users/PSI/Library/Caches"// output from the iOS simulator
Main.cpp: platformName(): "ios"
Main.cpp::main reading standardpath::DocumentsLocation: "/Users/PSI/Library/Application Support/iPhone Simulator/7.1/Applications/ID#/Documents"
Main.cpp::main reading standardpath::DataLocation: "/Users/PSI/Library/Application Support/iPhone Simulator/7.1/Applications/ID#/Documents"
Main.cpp::main reading standardpath::GenericDataLocation: "/Users/PSI/Library/Application Support/iPhone Simulator/7.1/Applications/ID#/Documents"
Main.cpp::main reading standardpath::CacheLocation: "/Users/PSI/Library/Application Support/iPhone Simulator/7.1/Applications/ID#/Library/Caches"
Main.cpp::main reading standardpath::GenericCacheLocation: "/Users/PSI/Library/Application Support/iPhone Simulator/7.1/Applications/ID#/Library/Caches" -
I have yet to actually submit anything to appstore. But I did find https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html more detailed and helpful than your link above about what belongs where.
BTW the fact you're still seeing the iOS standardpath DataLocation be Documents and not Library suggests you're not using Qt 5.4 yet... see https://bugreports.qt.io/browse/QTBUG-42276
My general impression is that stuff which doesn't belong in Documents/ (where the user can access the files by iTunes, if the app enabled file sharing) probably belong in Library/. If you really can re-generate them on-demand put them in Library/Caches but be aware iOS may blow them away if it wants to free space.
-
Thx for the reply and the link for reading.
Yep still on 5.3
Will probably leave records developed by the user in /Documents..makes sense for them to be backed up in iTunes. Wouldn't want stuff created by the user to be randomly deleted by iOS. That nugget of info is good to know!