kalix-systems/herald

Use appropriate data directories on iOS and Android

BaeoMaltinsky opened this issue · 3 comments

Currently, heraldcore uses the appropriate data directories on desktop platforms in the platform_dirs module.

There are implementations for Android and iOS, but they are placeholders and currently just use whatever $PWD Android and iOS happen to pass them. I believe there are well-defined (or at least, strongly suggested) application specific data directories on these platforms, but have not looked into exactly what they are.

One solution for this may be just to lean on Qt for this, as they've already done the work for us as just initialize it from QML using something like once_cell. Very plausibly we should just do this on every platform and drop the directories dependency, but I like being able to make heraldcore more self contained on desktop platforms.

for future reference:
iOS should place user generated data in /Library/Caches. Putting any files in /Documents is a security oversight.
Android should avoid using the media cache api, and just use the local file system for security reasons as well.

Sure, but that's relative to the root of the app bundle. I'd prefer to use an absolute path instead of walking the directory from the binary, hence the desire to lean on Qt to get the paths.