0

I'm using Xamarin.Forms and have this method to fetch my user object

    public static async Task<Object> GetCurrentUser()
    {
        try
        {
            return await BlobCache.UserAccount.GetObject<Object>("NewUser").FirstOrDefaultAsync();
        }
        catch (KeyNotFoundException)
        {
            return null;
        }
    }

The code works well on my iOS emulator but keeps crashing on the android with this error

System.Collections.Generic.KeyNotFoundException The given key 'NewUser' was not present in the cache.

Please I need help

Ada Orajiaku
  • 146
  • 1
  • 4

0 Answers0