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

[QUESTION] Caching different users data on a Xamarin Forms app #727

Open
rezamohamed opened this issue Oct 26, 2021 · 1 comment
Open

[QUESTION] Caching different users data on a Xamarin Forms app #727

rezamohamed opened this issue Oct 26, 2021 · 1 comment

Comments

@rezamohamed
Copy link

I am trying to get some clarity on how I can use Akavache for multiple users on the same phone for the same app.

I am currently using BlobCache.LocalMachine, and I am getting and setting cached data using GetOrFetchObject( key ) and InsertObject( key ). The data consists of text and images. What I am noticing is that the key here is just a generic identifier that I am giving to the data, hence regardless of who logs into my app, the data is getting refreshed based on the same key, not proprietary to that user.

BlobCache.UserAccount is just a different location of the db, but doesn't take into account which user is actually using the app.

Is there a way to globally assign a userID or something to the data being saved? If not, what should the approach be to save multiple user's data using akavache on the same device?

@rezamohamed
Copy link
Author

I was overthinking this, when I 'log out' of my app, since I am doing a vacuum, the data for that user is wiped out. When I log in again with the new credentials, a new cache is created so the other user's data is never shown.

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