How to prevent the cache memory from being cleared when updating my app in xamarin

kevin david 161 Reputation points
2023-05-02T14:35:33.87+00:00

Hello!

I need the cache memory of my application not to be deleted when updating it.

I need to retrieve session tokens. I used several methods like GetAccountsAsync. Since I use Microsoft authentication but when I update it returns null. As with the MonkeyCache tool, they work normally, but when I refresh the app, the token disappears.

In AppDelegate and MainActivity I have this

Barrel.ApplicationId = NSBundle.MainBundle.BundleIdentifier;

App class

                accessToken = Barrel.Current.Get<string>("access_token");

                //if (accounts.Count() > 0)
                if (!string.IsNullOrEmpty(accessToken))
                {
                    Helpers.Settings.IsLoged = true;
                }
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,291 questions
Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,447 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,385 questions
{count} votes