Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: use user's path to store user data (only relevant on native builds) #62

Open
endel opened this issue May 9, 2024 · 0 comments

Comments

@endel
Copy link
Member

endel commented May 9, 2024

I'm documenting this in case anybody needs this in the future. PRs are very welcome!


When building for native targets, our Storage class currently stores user data (the auth token) in the current folder, which can lead to file permission issues.

Chris from OpenFL (@dimensionscape) has pointed the right direction on how OpenFL solved this (thank you Chris!), by using the user's path:

Please take a look at https://github.com/openfl/openfl/blob/develop/src/openfl/net/SharedObject.hx if you'd like to see how we addressed this.

We use a location dubbed the applicationStorageDirectory which is resolved through our native extension in Lime https://github.com/openfl/lime/blob/bb3b31b08d75c0b9aa2dc1f3ab5f4539737f4d57/src/lime/system/System.hx#L419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant