import EncryptedStorage from 'react-native-encrypted-storage'; export async function getData(key: string): Promise { return new Promise((resolve, reject) => { EncryptedStorage.getItem(key).then(value => { if (value === undefined) resolve(null); else resolve(value); }); }); } export async function setData(key: string, value: string): Promise { return EncryptedStorage.setItem(key, value); }