import AsyncStorage from "@react-native-community/async-storage" ; param { string } key param { string } value returns { Promise . < void > } export async function SetStorageItemString ( key ? , value ? ) { if ( ! key ) { return Promise . reject ( new Error ( "Input parameter 'Key' is required" ) ) ; } if ( ! value ) { return Promise . reject ( new Error ( "Input parameter 'Value' is required" ) ) ; } return setItem ( key , value ) ; function setItem ( key , value ) { if ( navigator && navigator . product === "ReactNative" ) { return AsyncStorage . setItem ( key , value ) ; } if ( window ) { window . localStorage . setItem ( key , value ) ; return Promise . resolve ( ) ; } return Promise . reject ( new Error ( "No storage API available" ) ) ; } }