using AyCode.Interfaces.StorageHandlers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAMWebApp.Shared.Application.Interfaces;
using TIAMWebApp.Shared.Application.Models.ClientSide;

namespace TIAMMobileApp.Services
{ 
    public class SecureStorageHandler : ISecureStorageHandler
    {
        public async Task SaveToSecureStorageAsync(string key, string value)
        {
                       
            await SecureStorage.SetAsync(key, value);
            
        }

        public async Task<string> GetFromSecureStorageAsync(string key)
        {            
            return await SecureStorage.GetAsync(key);
        }

        public async Task DeleteFromSecureStorageAsync(string key)
        {
            SecureStorage.Remove(key);
        }

        public async Task ClearAllSecureStorageAsync()
        {
            SecureStorage.RemoveAll();
        }

    }
}
