Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Akavache loss information on IOS

We are using Akavache on project, in Android everything works great but on iOS we had some issue that is if we save a key value in the cache like this:

public async void Salvar(Login login) { await BlobCache.LocalMachine.InsertObject("login", login); }

BlobCache will save without erros, if i stop the debug session, and start again the debug and try do get the value using:

    public async Task<Login> Recuperar()
    {
                try
                {
                    var dados = await BlobCache.LocalMachine.GetObject<Login>("login");

                    return dados;
                }
                catch (KeyNotFoundException)
                {
                    return null;
                }
    }

i will get the KeyNotFoundException, i dont know why in Android works great but on iOS seeams that the database is gone after restart the app.

in my Xamarin config on Visual Studio check Preserve application data/cache on device between deploys is true and my

BlobCache.ApplicationName = "AppName";
at OnStar Method

Anyone knows what is happening? thanks

Answers

Sign In or Register to comment.